What will this code output? numbers = [1, 2, 3] for n in numbers: print(n + n)

Python Programming Quiz

Quiz
•
Information Technology (IT)
•
8th Grade
•
Medium
Fadi Fadi
Used 2+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
1 2 3
2 4 6
1 4 9
Error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these correctly loops through a list called data?
loop data:
for data in i:
for item in data:
data for item:
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is printed here? fruits = ["apple", "banana", "cherry"] print(fruits[-2])
apple
banana
cherry
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many times will this print "Hi"? for i in range(1, 5, 2): print("Hi")
1
2
3
4
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this code? nums = [1, 3, 5] for n in nums: print(n * 2)
2 4 6
1 3 5
2 6 10
1 6 25
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this function return? def add(x, y=2): return x + y print(add(3))
Error
5
6
"x + y"
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the final value of total? numbers = [2, 4, 6] total = 1 for n in numbers: total *= n
12
48
0
1
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
Python 8 klasa

Quiz
•
8th Grade
20 questions
Quiz on Error Types in Programming

Quiz
•
8th Grade
20 questions
Email, Hardware, Software, Troubleshooting, Input, Output

Quiz
•
6th - 8th Grade
20 questions
Ch. 5 Exam Review

Quiz
•
8th Grade
24 questions
Python Syntax and Logic Quiz

Quiz
•
8th Grade
20 questions
Quiz Fungsi Menu dan Ikon di Microsoft Excel

Quiz
•
8th Grade
15 questions
Keamanan Data (Informatika / Teknologi Informasi dan Komunikasi)

Quiz
•
8th Grade
20 questions
Microsoft Excel Review Part 2

Quiz
•
8th Grade - University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Information Technology (IT)
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University
44 questions
El fin del año- 7th

Quiz
•
7th - 12th Grade
40 questions
Word Study Assessment: Roots, Prefixes, Suffixes, and Vocabulary

Quiz
•
8th Grade
17 questions
guess the logo

Quiz
•
8th Grade
16 questions
Function or Non-Function?

Quiz
•
8th - 10th Grade
15 questions
Sentence Fragments and Run-ons

Quiz
•
8th Grade