Python for loop
Quiz
•
Computers
•
University
•
Medium
Sherif Abdelhamid
Used 35+ times
FREE Resource
Enhance your content in a minute
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
An infinite loop is :A loop runs infinite times when the condition-------------.
never fails
run one time
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
In programming, what is iteration/looping?
The repetition of steps within a program
The order in which instructions are carried out
A decision point in a program
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
numbers = [5, 14, 9, 17]
for number in numbers:
if number % 3 == 0:
print(number)
The output will be?
17
9
14
9
17
14
17
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
numbers = [5, 14 ,9, 17]
for number in numbers:
if number >= 9:
print (number)
The output will be?
17
9
14
9
17
14
17
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How many times does the following program print the word ‘computer’:
word= "computer"
for num in range(1,6):
print(word)
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following for loops would print the following numbers?
3
5
7
9
for i in range(3, 10, 2):
print(i)
for i in range(3, 9, 2):
print(i)
for i in range(9):
print(i)
for i in range(3,9):
print(i)
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Three of the for loops below will provide identical values for i. Which for loop will provide values that do not match the others?
for i in range(0, 5):
for i in range(5):
for i in range(0, 5, 1):
for i in range(5, 0, 1):
8.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What would be the output of the following code:
for i in range(3):
print(5)
0 1 2
3 3 3 3 3
5 5 5
0 1 2 3 4
Similar Resources on Wayground
10 questions
Microcontroller
Quiz
•
11th Grade - University
12 questions
ICT450-TOPIC 1
Quiz
•
University
7 questions
ESBrotherX_Medical AI_Lecture
Quiz
•
University
11 questions
Video Watermaking
Quiz
•
University
10 questions
NETIQUETTE AND DIGITAL FOOTPRINT
Quiz
•
University
10 questions
Data center
Quiz
•
University
10 questions
Microsoft Word
Quiz
•
6th Grade - University
10 questions
JSPS Competition Hackathon - Scratch Language - Grade 1
Quiz
•
2nd Grade - University
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
9 questions
Principles of the United States Constitution
Interactive video
•
University
18 questions
Realidades 2 2A reflexivos
Quiz
•
7th Grade - University
10 questions
Dichotomous Key
Quiz
•
KG - University
25 questions
Integer Operations
Quiz
•
KG - University
7 questions
What Is Narrative Writing?
Interactive video
•
4th Grade - University
20 questions
SER vs ESTAR
Quiz
•
7th Grade - University
