
Python For Loop Exercises
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Hard
Akirapeter Yong
Used 3+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? 以下代码的输出是什么?
0 1 2
1 2 3
0 1 2 3
1 2
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to iterate over a list in Python?
以下哪种是Python中遍历列表的正确方式?
`for i in list:`
`for i in range(list):`
`for i = 0; i < len(list); i++:`
`for i in len(list):`
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the `range(1, 5)` function generate?
range(1, 5) 函数会生成什么?
[1, 2, 3, 4, 5]
[1, 2, 3, 4]
[0, 1, 2, 3, 4]
[0, 1, 2, 3, 4, 5]
4.
DRAG AND DROP QUESTION
30 sec • 1 pt
Complete the code to print numbers from 0 to 4:
以下哪个关键字用于跳过当前循环迭代并进入下一次迭代?
for i in range( (a) ):
print(i)
3
4
6
5.
DROPDOWN QUESTION
30 sec • 1 pt
Fill in the blank to print each element of the list:
补全代码以打印列表中的每个元素:
for fruit in (a) :
fruit
range(fruits)
len(fruits)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
以下代码的输出是什么?
2 4
2 4 6
2 3 4 5
2 3 4 5 6
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to skip the current iteration of a loop and move to the next iteration?
以下哪个关键字用于跳过当前循环迭代并进入下一次迭代?
break
continue
pass
skip
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
Already have an account?
Similar Resources on Wayground
10 questions
Electricidad Básica
Quiz
•
12th Grade
15 questions
Programming basics
Quiz
•
12th Grade
14 questions
Pre-test: On Online searching by Innovative Teaching Ideas)
Quiz
•
6th - 12th Grade
10 questions
Premiere Pro
Quiz
•
10th - 12th Grade
13 questions
வகுப்பு 12 - அடோப் இன்டிசைன் CC 2019
Quiz
•
12th Grade
10 questions
Java: repetition control structure for & while
Quiz
•
10th - 12th Grade
12 questions
Sistemas de Información
Quiz
•
12th Grade
15 questions
Linux-2 Quiz 2 -- LAMP
Quiz
•
1st - 12th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
Discover more resources for Computers
15 questions
Internet Vocabulary Notebook Check #2 - CTEA(2024)
Quiz
•
12th Grade
11 questions
Internet Terms Vocabulary- Notebook Check #1- CTEA
Quiz
•
12th Grade
50 questions
Money Matters Fall 2025 Final Exam — Worksheet Questions
Quiz
•
12th Grade
47 questions
CSF Final Exam Practice
Quiz
•
9th - 12th Grade
