Quiz 1

Ace your homework & exams now with Quizwiz!

What is the output of the following code: value = 10while value < 20:value = value + 1print(value)

20

What is the output of the following code: value = 20while value < 20:value = value + 1print(value)

20

What is the output of the following code: value = 20while value < 20:value = value + 1print(value)

21

When a program runs the same code multiple times, it is called:

A loop

Which of these programs would be the best fit for a loop?

A program that looks for the smallest number in a list

What is the output of the following code: while value < 20:value = value + 1print(value)

An error occurs

What is a python library?

Code written by others that we can include in our programs

What is the output of the following code (please ignore newlines in the output)? animal = "dog"while animal == "dog":print("a")animal = "cat"print("b")print("c")

abc

What is the output of the following code (please ignore newlines in the output)?animal = "rabbit"while animal == "dog":print("a")animal = "cat"print("b")print("c")

c

A block of code preceded by while x < 10: continues iterating as long as what is true?

x is less than 10


Related study sets

Biology, Cognition, and Learning

View Set

French Unit 2 Speaking Test Part 1

View Set

Excel Solutions Chapter 11 Exam- New Jersey Laws and Rules Pertinent to Insurance

View Set