1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ghella [55]
3 years ago
14

: Write a function "def countWords(string)" that returns a count of all words in an input string represented by the variable 'st

ring'.
Computers and Technology
1 answer:
Zina [86]3 years ago
3 0
We can define a word as a group of characters without a space between them. To find the words of the input string , w can use split(delimiter) which returns a list of strings which had the defined delimiter between them in the input string.

def countWords(string):
words = string.split(" ")
count = len(words)
return count

Here we set the delimiter as the space character, and returned the length of the words list. I split each step into its own line for readability, however the function could be one line:

return len(string.split())

Here, no delimiter is specified. If one isn't given, it will default to split at any whitespace, including space.

You might be interested in
Why should data anaylst should learn about computer arichtecture.
torisob [31]
The knowledge serves as good foundation for me to understand how technology works behind the scene as well. So I must say a good understanding of computer architecture gives the data scientist the ability to propose feasible solution in capturing and maintaining data, implementing models and algorithms in IT systems.
8 0
3 years ago
Chegg A full bootstrap program Select one: a. may be infected by viruses. b. is stored in ROM to ensure to avoid any infection f
harina [27]

Answer:

Option b = "is stored in ROM to ensure to avoid any infection from viruses. "

Explanation:

In order to to understand the fundamentals of an Operating system in computer one needs to know what the bootstrap program is.

The BOOTSTRAP PROGRAM is first program that will run when the computer is switched on, thus the program( the BOOTSTRAP PROGRAM) will be the program to open the OPERATING SYSTEM.

The device in laptops and personal computers known as ROM is an acronym that stands for Read-Only Memory and it is a storage medium. Because of ROM inability to get Virus it is used in the storage of Bootstrap program.

8 0
3 years ago
Determine the number of bytes necessary to store an uncompressed RGB color image of size 640 × 480 pixels using 8, 10, 12 and 14
dexar [7]

Answer:

For 8 bits / Color Channel: 921, 600 bytes.

For 10 bits / Color Channel: 1,152,000 bytes.

For 12 bits / Color Channel: 1,382,400 bytes.

For 14 bits / Color Channel : 1,612, 800 bytes.

Explanation:

Un uncompressed RGB color image of 640 pixels wide by 480 pixels height (VGA resolution) uses 3 samples of x bits fin order to represent the quantity of each primary color (red, green and blue) in a given pixel of the image.

So, if we use 8 bits/ sample, we can calculate the bytes needed to store a complete image as follows:

640*480*3*8 bits = 7, 372,800 bits. (1)

As, by definition, 1 byte= 8 bits, we have:

Nº of bytes = 7,372,800 / 8 = 921,600 bytes. (2)

In order to get the bytes needed to store the same image, using 10, 12 and 14 bits/ sample, all we need is replacing 8 by 10, 12 and 14 in (1), and then dividing by 8 as in (2).

Proceeding in this way we obtain:

640*480*3*10 = 9,216,000 bits ⇒    1,152,000 bytes.

640*480*3*12 = 11,059,200 bits ⇒   1,382,400 bytes.

640*480*3*14=   12,902,400 bits ⇒  1,612,800 bytes.

8 0
4 years ago
In total, how many 8-bit registers are there in the Intel 80x86 CPU design presented in class? Name one of these 8-bit registers
RSB [31]

Answer:

In general the number of  bit registers in Intel 80x86 CPU design when combined together forms a 16 - bit register

An example of the  -bit registers are AH, AL, BH, BL, CH, CL, DH, and DL

Explanation:

Solution

The 8086 CPU design has a total of eight 8-bit registers and these register can be integrated together to make 16- bit register as well.

The 16-bit data is stored by breaking the data into a low-order byte and high order byte.

The name of the 8 bit registers is shown below:

AH, AL, BH, BL, CH, CL, DH, and DL

7 0
3 years ago
When researching Information about technology for use in a project, it is NOT important to consider the date that the informatio
REY [17]

Answer:

B. False

Explanation:

Hope this helps!

4 0
2 years ago
Other questions:
  • Word 2013 opens, by default, on a blank document?
    13·2 answers
  • Abram was asked to explain to one of his coworkers the XOR cipher. He showed his coworker an example of adding two bits, 1 and 1
    5·1 answer
  • What are two reasons for using layered protocols? what is one possible disadvantage of using layered protocols?
    13·1 answer
  • Anderson uses his computer and internet link to chart the movement of his favorite 46 stocks. He buys and sells according to the
    15·1 answer
  • Susie works for an architectural firm and the partners have always drawn the plans for projects by hand. Though Susie learned ho
    8·1 answer
  • In the lecture, we saw that TCP waits until it has received three duplicate ACKs before performing a fast retransmit. Why do you
    10·1 answer
  • Write a function that creates a one-dimensional game board composed of agents of two different types (0 and 1, X and O, stars an
    11·1 answer
  • Write a function that parses a binary number into a hex number. The function header is:def binaryToHex(binaryValue)Write a test
    11·1 answer
  • SOMEONE HELP ME PLEASE <br> What are three reasons technology is beneficial to teens
    11·1 answer
  • Can a dod activity enter into a service contract for a military flight simulator without getting a waiver from the secretary of
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!