Skill #2 - Flow Control with Decisions and Loops
Quiz
•
Instructional Technology
•
12th Grade
•
Medium
Marissa Montes
Used 5+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code?
b or a = False
b or a True
b is True
b or a = True
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
We have the following variables and their values:
grade_a = 9.5
grade_b = 8.7
grade_c = 8
Select the true statement.
grade_c == int(grade_b)
int(grade_a) > math.ceil(grade_b)
grade_c < int(grade_b)
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
In Python there are certain keywords that are used in a loop.
One of them is used when one condition needs to be temporarily ignored.
Which one?
continue
pass
break
for
while
4.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Choose the code that has the following output:
S
*U
**P
***E
****R
*****A
******T
*******E
name = "SUPERATE"
i = 0
for letter in name:
print("*" * i+letter)
i+=1
name = "SUPERATE"
i = 0
for letter in name:
print("*" , i,letter)
i++
name = "SUPERATE"
i = 0
for letter in name:
print("*i" +letter)
name = "SUPER"
i = 1
for letter in name:
print("*" * i)
i+=1
5.
DROPDOWN QUESTION
3 mins • 1 pt
The myth says that a peasant beat a king in chess and as a prize he asked for wheat grains. One grain for the first chessboard square, 2 for the second and double the previous grains for each subsequent square. (64 squares in total) Your code need to output the amount of wheat grains for each chessboard square. Complete the code accordingly.
grains = 1
(a)
grains = 2 ** (square-1)
print("Square", square, "total grains =", grains)
6.
DRAG AND DROP QUESTION
3 mins • 1 pt
We have an array of a part of the Fibonacci sequence. In a Fibonacci sequence every number after the first two is the sum of the two preceding ones. Unfortunately, we have mistankenly added a number not in the sequence. We want our code to print all the numbers in the array until it reaches the false number.
fib = [1,1,2,3,5,6,8,13,21]
print(fib[0])
print(fib[1])
pos = 2
(a) (pos < len(fib)):
if fib[pos-2] + fib[pos-1] != fib[pos]:
(b)
else:
print(fib[pos])
(c)
7.
REORDER QUESTION
3 mins • 1 pt
We need to create a function to return a message to the first three finalists.
If they finished second the message would be You won a Silver medal.
If they finished third the message would be You won a Bronze medal.
Reorder the following:
print("You won a Bronze medal")
elif placement == 3:
def medals(placement):
print("You won a Silver medal")
if placement == 2:
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
11 questions
Communication Skills In the Beauty Industry
Quiz
•
10th - 12th Grade
10 questions
Battery Quiz
Quiz
•
9th - 12th Grade
15 questions
Hydraulic brake system
Quiz
•
10th - 12th Grade
10 questions
Motion Information and Media Quiz
Quiz
•
12th Grade
10 questions
ONLINE SYSTEMS, FUNCTIONS AND PLATFORMS
Quiz
•
11th - 12th Grade
15 questions
Genres of Literature
Quiz
•
8th Grade - University
13 questions
Jets
Quiz
•
1st Grade - Professio...
14 questions
Woodshop Safety
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
20 questions
MINERS Core Values Quiz
Quiz
•
8th Grade
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
20 questions
Multiplying and Dividing Integers
Quiz
•
7th Grade
10 questions
How to Email your Teacher
Quiz
•
Professional Development
15 questions
Order of Operations
Quiz
•
5th Grade
Discover more resources for Instructional Technology
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
28 questions
Ser vs estar
Quiz
•
9th - 12th Grade
15 questions
PRESENTE CONTINUO
Quiz
•
9th - 12th Grade
16 questions
Subject pronouns in Spanish
Quiz
•
9th - 12th Grade
14 questions
Model and Solve Linear Equations
Quiz
•
9th - 12th Grade
17 questions
Graduation Requirements Review
Quiz
•
9th - 12th Grade
20 questions
Food Chains and Food Webs
Quiz
•
7th - 12th Grade
