
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
10 questions
Aula 4 - IC

Quiz
•
University
10 questions
Quiz 4

Quiz
•
University
20 questions
UH Scratch

Quiz
•
9th Grade
15 questions
LKPD I_Aplikasi Pengolah Kata

Quiz
•
10th Grade
15 questions
Bài 25

Quiz
•
10th Grade - University
20 questions
Тест по основам Python(intro1)

Quiz
•
9th - 12th Grade
15 questions
Quiz về Kiểu Dữ Liệu List và Set (1)

Quiz
•
7th Grade - University
15 questions
Bài 26

Quiz
•
10th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Information Technology (IT)
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
24 questions
Scientific method and variables review

Quiz
•
9th Grade
20 questions
Getting to know YOU icebreaker activity!

Quiz
•
6th - 12th Grade
20 questions
Biomolecules

Quiz
•
9th Grade
12 questions
Graphing Inequalities on a Number Line

Quiz
•
9th Grade
20 questions
Cell Organelles

Quiz
•
9th Grade
20 questions
Oceans and Continents Quiz

Quiz
•
9th Grade