
Learning Outcomes
Authored by Patrick Toner
Computers
Professional Development
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A loop repeats an action until a condition is met. What is a loop?
A sequence of instructions that is continually repeated until a certain condition is reached.
A single execution of a set of instructions.
A type of variable used in programming.
A method to store data in a database.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Write a basic Python loop (using for) to repeat a simple task. Goal: You will write a basic Python loop (using for) to repeat a simple task. Example: Print your name 3 times.
for i in range(3): print('Your Name')
while i < 3: print('Your Name')
print('Your Name' * 3)
repeat 3 times: print('Your Name')
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Fill in the blank: A loop is a piece of code that runs again and again until we tell it to ____.
stop
start
pause
continue
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A for loop is used to:
Iterate over a sequence of elements
Define a function
Store data in a variable
Terminate a program
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code do? for i in range(5): print('Hello, world!')
Prints 'Hello, world!' 5 times
Prints 'Hello, world!' 4 times
Prints 'Hello, world!' 6 times
Does not print anything
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the code example, what does 'range(5)' do?
Creates a list of numbers: 0, 1, 2, 3, 4
Creates a list of numbers: 1, 2, 3, 4, 5
Creates a list of numbers: 0, 1, 2, 3, 4, 5
Creates a list of numbers: 1, 2, 3, 4
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Change the code to print your name 3 times. for i in range(3): print("Your Name")
for i in range(3):\n print("Your Name")
for i in range(3):\n print("My Name")
for i in range(3):\n print("Your Name" * 3)
for i in range(3):\n print("My Name" * 3)
Access all questions and much more by creating a free account
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
Already have an account?