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

Python Programming Quiz

Quiz
•
Information Technology (IT)
•
1st Grade
•
Easy
Fadi Fadi
Used 4+ times
FREE Resource
22 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 keyword is used to loop through a list?
loop
iterate
for
each
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is printed here? fruits = ["apple", "banana", "cherry"] print(fruits[1])
apple
banana
cherry
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many times will this print "Hi"? for i in range(3): print("Hi")
1
2
3
4
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this code? nums = [2, 4, 6] for n in nums: print(n + 1)
2 4 6
3 5 7
1 3 5
2 5 7
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does this function return? def add(x, y): return x + y print(add(3, 4))
Error
7
34
"x + y"
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the final value of total? numbers = [1, 2, 3, 4] total = 0 for n in numbers: total += n
9
10
24
0
Create a free account and access millions of resources
Similar Resources on Quizizz
26 questions
Battle kelas 1

Quiz
•
1st Grade
24 questions
SOAL Pra-Responsi - Praktikum Struktur Data

Quiz
•
1st Grade
20 questions
Belajar Microsoft Excel

Quiz
•
1st Grade
22 questions
Tin5. Ôn thi cuối HK1 - PĐ1

Quiz
•
1st - 5th Grade
20 questions
TailwindCSS Font Size dan Font Family Pert-2

Quiz
•
1st Grade
24 questions
1ºESO - TECNOLOGIA - REPASO TEMA 1

Quiz
•
1st Grade
20 questions
TailwindCSS Container Pert-6

Quiz
•
1st Grade
20 questions
Python Basics Quiz

Quiz
•
1st Grade
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)
10 questions
American Flag

Quiz
•
1st - 2nd Grade
10 questions
Identifying equations

Quiz
•
KG - University
25 questions
2.4A Add Subtract within 20 quickly: set 3

Quiz
•
1st - 3rd Grade
15 questions
Music 2016

Quiz
•
KG - 12th Grade
12 questions
Summer Trivia

Quiz
•
1st - 5th Grade
44 questions
logos

Quiz
•
KG - University
20 questions
Guess that Disney

Quiz
•
KG - 5th Grade
20 questions
Cartoon Characters!

Quiz
•
KG - 5th Grade