Python Quiz (More Loops)

Python Quiz (More Loops)

KG - 6th Grade

9 Qs

quiz-placeholder

Similar activities

CODEHS Looping Unit 5 Review

CODEHS Looping Unit 5 Review

9th - 12th Grade

10 Qs

Exit Ticket 1/17

Exit Ticket 1/17

9th - 12th Grade

12 Qs

Cuestionario de JavaScript

Cuestionario de JavaScript

6th Grade

14 Qs

Rumus Dasar Excel

Rumus Dasar Excel

1st Grade

10 Qs

Java 1D Arrays

Java 1D Arrays

9th Grade - University

14 Qs

VBA 2

VBA 2

12th Grade

10 Qs

Ciclos Python

Ciclos Python

University

13 Qs

C Programming

C Programming

Professional Development

10 Qs

Python Quiz (More Loops)

Python Quiz (More Loops)

Assessment

Quiz

Computers

KG - 6th Grade

Hard

Created by

Jerry Xiao

Used 27+ times

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Which of the following is the correct syntax of a while loop in Python

while condition:

ㅤㅤstatements

While condition:

ㅤ statements

while conditionㅤ

ㅤstatements

while condition: ㅤ

ㅤstatements;

2.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Which of the following is a ‘condition-controlled’ loop?

for

while

3.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Which of the following is a ‘count-controlled’ loop?

for

while

4.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Which of the following is an incorrect ‘for’ loop?

for var in [1.2.3.4]:

for var in range(1):

for var in range(1,2,3):

for var in range(1,2,3,4,5):

5.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Which of the following is an incorrect ‘for’ loop?

for var in range(5,1,-1):

for var in range(1,5,1):

for var in range(1,5,2):

for var in range(1,5,-1):

6.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

What will be the output of the following Python code?


for num in range(1, 2, 3):

print(num)

123

1 2 3

num

1

7.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

What will be the output of the following Python code?


for num in range(2):

print(num)

0 1

1 2

0 1 2

2

8.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

What will be the output of the following Python code?


for num in range(1, 3):

print(num)

0 1

1 2

1 2 3

2 3

9.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Which of the below statements is equal to:

sum = sum + number

sum = sum ++ number

sum += number

sum += sum + number

number += sum