
Python for loop/lists

Quiz
•
Information Technology (IT)
•
9th Grade
•
Easy
Fadi Fadi
Used 4+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does a for loop do in Python?
Repeats a block of code while a condition is true
Chooses a random element from a list
Repeats a block of code for each item in a sequence
Declares a function
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this code? python CopyEdit fruits = ['apple', 'banana', 'cherry'] for fruit in fruits: print(fruit)
apple banana cherry
['apple', 'banana', 'cherry']
fruit fruit fruit
Error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid list?
[1, 2, 3, 4]
(1, 2, 3, 4)
{1, 2, 3, 4}
"1, 2, 3, 4"
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many times will this loop run? for i in range(5): print(i)
4
5
6
Infinite
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the index of 'dog' in this list? animals = ['cat', 'dog', 'lion']
0
1
2
3
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this print? python CopyEdit numbers = [10, 20, 30] print(numbers[1])
10
20
30
Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of range() in a for loop?
To shuffle the list
To create a loop that counts
To sort items
To reverse a list
Create a free account and access millions of resources
Similar Resources on Wayground
13 questions
Python Programming Quiz

Quiz
•
University
16 questions
Python тесті

Quiz
•
9th Grade
10 questions
Quiz1 Kelas XII

Quiz
•
12th Grade
20 questions
Algoritma Struktur Data

Quiz
•
University
20 questions
Python Quiz Girls in ICT Day

Quiz
•
University
10 questions
Python Basics Quiz

Quiz
•
8th Grade - University
15 questions
Selection Programming_If condition

Quiz
•
8th Grade - University
10 questions
Refresh Python

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Information Technology (IT)
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
12 questions
Graphing Inequalities on a Number Line

Quiz
•
9th Grade
20 questions
Cell Organelles

Quiz
•
9th Grade
28 questions
Ser vs estar

Quiz
•
9th - 12th Grade
15 questions
Two Step Equations

Quiz
•
9th Grade
17 questions
Continents and Oceans

Lesson
•
5th - 9th Grade