
For Loop List
Presentation
•
Computers
•
8th Grade
•
Medium
Asma Al-Faran
Used 45+ times
FREE Resource
0 Slides • 21 Questions
1
Fill in the Blanks
Will it print the items in a list on same line or separate line?
languages = ["Java", "Python", "C"]
for x in languages:
print(x)
Type answer...
2
Fill in the Blanks
What is the output?
languages = ["Java", "Python", "C"]
for x in languages:
print(x)
Type answer...
3
Fill in the Blanks
What is X?
for x in languages:
print(x)
Type answer...
4
Fill in the Blanks
What is language?
for x in languages:
print(x)
Type answer...
5
Fill in the Blanks
What is the output?
for x in "Python":
print(x)
Type answer...
6
Fill in the Blanks
What is python?
for x in "Python":
print(x)
Type answer...
7
Fill in the Blanks
for counter in range(10):
print(counter)
What will be the final line output by this program?
(Type your answer as a number)
Type answer...
8
Multiple Choice
Choose the correct output of the following code.
for i in range(10,15):
print(i)
10
11
12
13
14
10
11
12
13
14
15
11
12
13
14
Error
9
Multiple Choice
What is the output of the following:-
x = "123"
for i in x:
print("a")
x
1
a
1
2
3
x
1
2
3
a
a
a
10
Multiple Choice
What is the output of the following:-
print(list(range(10)))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[1,2,3,4,5,6,7,8,9,10]
[2,3,4,5,6,7,8,9,10,11]
[0,1,2,3,4,5,6,7,8,9,10]
11
Multiple Choice
Choose the correct answer
for i in "python":
print(i)
Error
p
y
t
h
o
n
p?y?t?h?o?n?
both b and c
12
Multiple Choice
Choose the correct answer
for i in "python":
print(i, end="?")
Error
p
y
t
h
o
n
p?y?t?h?o?n?
both b and c
13
Multiple Choice
What will be the output of the following Python code?
x = 'abcd'
for i in range(len(x)):
print(i)
1234
abcd
0123
error
14
Multiple Choice
code:
___ counter in range(2):
print(counter)
What word is missing from the code above. The program outputs the numbers 0 and 1.
and
for
while
if
nor
15
Multiple Choice
Choose the set of values of i that will be displayed on the screen.
for i in range(1,6):
print(i*2)
2,4,6,8,10
1,2,3,4,5
1,2,3,4,5,6,
2,4,6,8,10,12
16
Multiple Choice
Choose the set of values of i that will be displayed on the screen.
for i in range(2,5):
print(i)
2
3
4
1,2,3,4,5
1,2,3,4,5,6,
2,4,6,8,10,12
17
Multiple Choice
What is the result of running the following code?
nums = [3, 6, 10]
for i in nums:
print(i-1)
2
5
9
3
6
10
3
4
5
6
7
8
9
2,4,6,8,10,12
18
Multiple Choice
What is the result of running the following code? Exiting the loop with break
nums = [3, 6, 7, 10, 24, 25]
for i in nums:
print(i)
if i ==10:
break
2
5
9
3
6
7
10
3
4
5
6
7
8
9
2,4,6,8,10,12
19
Multiple Choice
What is the result of running the following code? Exiting the loop with break
nums = [3, 6, 7, 10, 24, 25]
for i in nums:
if i ==10:
print(i)
break
2
5
9
3
6
7
10
3
4
5
6
7
8
9
10
20
Multiple Choice
Choose the set of values of i that will be displayed on the screen.
for x in range(2, 5):
print(x)
else:
print("Done!")
2
3
4
Done!
3
4
5
Done!
2
3
4
5
Done!
2
3
4
last item: 4
21
Multiple Choice
Choose the set of values of i that will be displayed on the screen.
for x in range(2, 5):
print(x)
else:
print("last item: ", x)
2
3
4
3
4
5
last item
2
3
4
5
last item: 5
2
3
4
last item: 4
Will it print the items in a list on same line or separate line?
languages = ["Java", "Python", "C"]
for x in languages:
print(x)
Type answer...
Show answer
Auto Play
Slide 1 / 21
FILL IN THE BLANKS
Similar Resources on Wayground
17 questions
Presentation Software -MS PowerPoint
Presentation
•
8th Grade
18 questions
Računalne baze podataka
Presentation
•
8th Grade
16 questions
Classroom Expectations!
Presentation
•
8th Grade
16 questions
Articles of Confederation/Constitutional Convention
Presentation
•
8th Grade
16 questions
Acids, Bases, & Salts
Presentation
•
8th Grade
16 questions
Números enteros
Presentation
•
8th Grade
16 questions
Logical Fallacies
Presentation
•
8th Grade
16 questions
Distance Formula
Presentation
•
8th Grade
Popular Resources on Wayground
6 questions
PRIDE Always and Everywhere
Presentation
•
12th Grade
20 questions
Lab Safety Quiz
Quiz
•
6th Grade
26 questions
KOR Review Kahoot Questions
Quiz
•
8th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
12 questions
Unit Zero lesson 2 cafeteria
Presentation
•
9th - 12th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
10 questions
Riddles Riddles fun Riddles
Quiz
•
6th - 12th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade