Python Code Quiz

Quiz
•
Computers
•
8th - 12th Grade
•
Hard
Used 84+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which of the following data object/structures are iterables?
Number
String
List
Char
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code print?
my_iterable = [1, 2, 3]
for item_name in my_iterable :
- print(my_iterable[item_name - 1])
Error
3,2,1
1,2,3
1,2
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code output?
my_list = [1,2,3,4,5,6,7,8,9,10]
for each_item in my_list:
- if each_item % 2 != 0:
-- print(each_item)
All even numbers
All odd numbers
All the numbers
None
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the code output?
subtract = 0
my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
for each_item in my_list:
- subtract += each_item
-- print(subtract)
-55
0
-5
55
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
mystring = "hello"
for letter in mystring :
- print(mystring.find(letter))
0,1,2,2,4
0,1,2,3,4
0,1,1,2,4
0,1,2,3,3
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code output?
myTuple = [(1, 2), (3, 4), (5, 6)]
for (a, b) in myTuple :
- print(a + b)
1,2,3,4,5,6
1,3,5
2,4,6
3,7,11
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
x = 0
while x < 5:
- print(f'The current value of x is {x}')
-- x = x + 2
2,4
2,4,6
0,2,4
0,2,4,6
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Representing and understanding algorithms

Quiz
•
10th - 11th Grade
10 questions
PYTHON (FOR LOOP)

Quiz
•
1st - 10th Grade
15 questions
list in python

Quiz
•
10th - 12th Grade
10 questions
Year 8 Python

Quiz
•
8th Grade
10 questions
Quiz 13 - For Loops

Quiz
•
11th Grade
10 questions
Bài tập thực hành 1 (tiết 2)

Quiz
•
12th Grade
10 questions
Java: repetition control structure for & while

Quiz
•
10th - 12th Grade
10 questions
PCEP Section 1E: Perform Input/Output console operations

Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
20 questions
Analog vs Digital

Quiz
•
9th - 12th Grade
10 questions
CTEA Computer Vocab Terms #1

Quiz
•
12th Grade
10 questions
Exploring Cybersecurity Techniques and Threats

Interactive video
•
6th - 10th Grade
10 questions
Understanding the Internet and Data Transmission

Interactive video
•
7th - 12th Grade
25 questions
How to Email a Teacher- https://youtu.be/NioeNhfpVfI

Quiz
•
6th - 8th Grade
20 questions
Computer Hardware

Quiz
•
6th - 8th Grade