
Python Loops and Range Quiz
Authored by Nicholas Marsh
Computers
12th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax of a for loop in Python?
for item in iterable:
for i in integer:
for loop in string:
for item in iterable
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How is the range function used in Python?
The range function in Python is used to generate a sequence of numbers.
The range function in Python is used to calculate the average of a sequence of numbers.
The range function in Python is used to sort a sequence of numbers in ascending order.
The range function in Python is used to find the maximum value in a sequence of numbers.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of looping through lists in Python?
To skip over each element in the list without performing any action or operation.
To reverse the order of the elements in the list.
To check if a specific element is present in the list without iterating through all elements.
To iterate over each element in the list and perform a specific action or operation on each element.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? numbers = [1, 2, 3, 4, 5] for num in numbers: print(num * 2)
2, 4, 6, 8, 10
1, 3, 5, 7, 9
2, 4, 6, 8
1, 2, 3, 4, 5
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? for i in range(5): print(i)
1 2 3 4 5
0 1 2 3 5
0 1 2 3 6
0 1 2 3 4
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? for i in range(1, 6, 2): print(i)
1 2 3 4 5
1 2 3 4
1 3 5 7
1 3 5
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? fruits = ['apple', 'banana', 'cherry'] for fruit in fruits: print(fruit)
apple banana cherry
apple banana cherry
apple cherry banana
banana apple cherry
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?
Similar Resources on Wayground
10 questions
Logic Gates
Quiz
•
9th - 12th Grade
10 questions
Word basics
Quiz
•
8th - 12th Grade
10 questions
Aspek Legal TIK
Quiz
•
12th Grade
10 questions
Administrasi Sistem Jaringan
Quiz
•
12th Grade
10 questions
Tarkie Seminar for Disers
Quiz
•
9th - 12th Grade
10 questions
python-BTxâu
Quiz
•
9th - 12th Grade
12 questions
HTML
Quiz
•
9th - 12th Grade
14 questions
TRENDS IN ICT
Quiz
•
12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade