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 12:00, Cocco
Which of the following does 3d animation create an illusion of on the screen? a. depth b. emotion c. length d. dialogue
Answers: 1
image
Computers and Technology, 23.06.2019 03:30, bellsbella34
Ihave a singular monitor that is a tv for my computer. recently, i took apart my computer and put it back together. when i put in the hdmi cord and booted the computer to see if it worked, the computer turned on fine but the screen was blue with "hdmi no signal." i've tried everything that doesn't require buying spare parts, any answer is appreciated!
Answers: 1
image
Computers and Technology, 23.06.2019 17:30, kenyasutton10
What are the most commonly found items in the trash according to the municipal solid waste report?
Answers: 1
image
Computers and Technology, 24.06.2019 02:10, sIatt
Consider the usual algorithm to convert an infix expression to a postfix expression. suppose that you have read 10 input characters during a conversion and that the stack now contains these symbols: (5 points) | | | + | | ( | bottom |_*_| now, suppose that you read and process the 11th symbol of the input. draw the stack for the case where the 11th symbol is
Answers: 2
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:

Konu
Mathematics, 24.02.2020 23:39