Looping

Ace your homework & exams now with Quizwiz!

C

How many lines will this program print? while True: print "hi" A. 0 B. 1 C. an infinite number of lines

B

How many lines will this program print? x = 10 while x > 0: print x x = x - 3 A. 3 B. 4 C. 5 D. 6

C

Which of the following best describes the purpose of a for loop? A. A for loop is for doing something an indeterminate number of times. B. A for loop is doing something an infinite number of times. C. A for loop is for doing something a fixed number of times. D. A for loop is for doing something three times.

A

Which of the following programs prints ten lines? A. for i in range(10): print "hi" B. for i = 1 to 10: print "hi" C. for i in 1 - 10: print "hi" D. for i from 0 to 9: print "hi"


Related study sets

Evolution of European Thought Take-home Test

View Set

OOP + Python3 Basics coding exercises

View Set

Mental Health ATI Adaptive Quizzes

View Set

Human resource management chapter for homework

View Set

MARK Chp 12 video assignment questions

View Set

Night (Section 5 & 6) test 3/13/18

View Set