stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
CEIS110Week3 Flashcards | StudBud
Explore
/
CEIS110Week3
CEIS110Week3
10 terms
·
StudBud Administration
·
1 play
Imported from external platform
Flashcards
10 cards
F
Practice quiz
P
Host live
L
Questions
10
Answers
1
Which Python module is imported for mathematical operations in Python
time
sys
math
random
2
What is the output if gallonsNeeded is greater than 5?
"You have enough paint"
"You will pay the normal price"
"You need more paint"
"You have qualified for a discount"
3
How many times will the body of the loop execute in a counter-controlled loop?
Until a condition is met
A specific number of times
Only once
Forever
4
What function is used to read user input in Python?
input()
read()
scanf()
get()
5
What statement can break out of an infinite loop?
break
continue
return
exit
6
What is the purpose of a repetition structure (loop)?
Both A and B
To execute a statement or set of statements repeatedly
To avoid duplicate code
To write a long sequence of statements
7
what does the range(5) function produce?
1 2 3 4 5
0 1 2 3 4
5 4 3 2 1
2 4 6 8 10
8
What is the correct way to initialize a counter in a while loop?
counter != 0
counter == 0
counter = 0
counter = "zero"
9
Which keyword is used to define a loop that continues until a condition is no longer true?
else
if
for
while
10
What is the output of the following code if the input is 'python': print(letter, end="")?
p y t h o n
error
p\ny\nt\nh\no\nn
python