Python Day - 3

Python Day - 3

8th Grade

10 Qs

quiz-placeholder

Similar activities

L4 Iteration

L4 Iteration

8th Grade

10 Qs

Python - Loops & Lists

Python - Loops & Lists

7th - 11th Grade

15 Qs

FOR Loop Python

FOR Loop Python

6th - 8th Grade

13 Qs

KODEKIDDO HACK #MLH3

KODEKIDDO HACK #MLH3

4th Grade - University

10 Qs

Banana Tales Part I (1-40)

Banana Tales Part I (1-40)

6th - 8th Grade

10 Qs

PYTHON (FOR LOOP)

PYTHON (FOR LOOP)

1st - 10th Grade

10 Qs

Intro to Python

Intro to Python

8th Grade

10 Qs

10.4 Python Lists

10.4 Python Lists

7th - 10th Grade

14 Qs

Python Day - 3

Python Day - 3

Assessment

Quiz

Computers

8th Grade

Medium

Created by

KIRAN KUMAR G

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a loop in Python?

To define functions

To repeatedly execute a block of code

To store data values

To print messages

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which type of loop is used to iterate over a sequence in Python?

While loop

If loop

For loop

Repeat loop

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a "for" loop, what does the variable after "for" represent?

The condition

The iteration variable

The sequence to be looped

The loop counter

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following "for" loop:
numbers = [1, 2, 3, 4]

for num in numbers:

print(num * 2)

1 2 3 4

2 4 6 8

1 4 9 16

2 3 4 5

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What statement is used to exit a "for" loop prematurely in Python?

exit

terminate

stop

break

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

"predict the output"

for i in range (1 , 6 , 2):

  print(i)

1 2 3

1 3 5

2 4 5

1 3 6

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following "for" loop:

a  = [1 , 2 , 3, 5, 7]

for i in a:

  if i == 3:

    continue

  print(i)

0 1 2 3

2 3 4 6

1 2 3 4

1 2 5 7

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?