Computers and Technology

1. Select the statement you would need with in a “while true:” loop to control the number of iterations: a) for statement
b) nested while statement
c) range statement
d) relational operators

2. For which programming task would you use a while loop?
a) Computing the average of a list of 30 integers
b) Copying the contents of one list of 500 characters to another list
c) Drawing a circle with a specified radius
d) Waiting for a keyboard key to be pressed

3. For a Python program that reads every third integer in a list, which arguments of the range function should you specify?
a) A start, a stop, and a step argument
b) A start and a stop argument
c) No arguments
d) One stop argument

4. Which of the following is an accurate description of the way in if statement operates?
a) When the if conditional evaluates to False, the if clause statements are run.
b) When the if conditional evaluates to True, the if clause statements are run.
c) Program execution returns to the beginning of the if statement after the if clause statements are run.
d) When the if conditional evaluates to True, the program execution continues after the if statement.

5. Suppose you are writing a program that counts the number of alphanumeric characters in every sentence in the document. Would you use a for loop or a while loop to process each sentence, and why?
a) A for loop because the program must establish maximum sentence length.
b) A for loop to control the number of characters the program will process in each sentence.
c) A while loop because the program cannot predict the length of a sentence.
d) A while loop to specify the list of alphanumeric characters the program will recognize.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:30, messyquestions
Plz 40 points what are raster vectors? a bitmap image a vector file a type of printing press a small projector
Answers: 1
image
Computers and Technology, 22.06.2019 10:00, adam4449
Jackson is teaching the decimal number system. he wants his students to know how to expand numbers by powers of 10. which is the correct order in which digits are assigned values in the decimal number system?
Answers: 1
image
Computers and Technology, 23.06.2019 00:30, vane3152
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
image
Computers and Technology, 23.06.2019 05:30, savyblue1724707
Sally is editing her science report about living things. she needs to copy a paragraph from her original report. order the steps sally needs to do to copy the text to her new document.
Answers: 1
Do you know the correct answer?
1. Select the statement you would need with in a “while true:” loop to control the number of iterati...

Questions in other subjects: