Python Code Quiz

Python Code Quiz

8th - 12th Grade

11 Qs

quiz-placeholder

Similar activities

Quiz Kelas 8

Quiz Kelas 8

8th Grade

15 Qs

conditional constructs in Java

conditional constructs in Java

10th Grade

10 Qs

Bai Tap Bai 18 Tin hoc 10

Bai Tap Bai 18 Tin hoc 10

10th Grade

10 Qs

ÔN TẬP HKII-02

ÔN TẬP HKII-02

8th Grade

15 Qs

Los periféricos del computador

Los periféricos del computador

1st Grade - Professional Development

9 Qs

ASESMEN INFORMATIKAN BAB 1 SERI 2

ASESMEN INFORMATIKAN BAB 1 SERI 2

10th Grade

15 Qs

CSS background, border

CSS background, border

11th Grade

10 Qs

Bài 6_Lớp 11_Tại lớp

Bài 6_Lớp 11_Tại lớp

12th Grade

10 Qs

Python Code Quiz

Python Code Quiz

Assessment

Quiz

Computers

8th - 12th Grade

Practice Problem

Hard

Used 86+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?