Python for loop

Python for loop

University

8 Qs

quiz-placeholder

Similar activities

kuis cepat sejarah perkembangan komputer

kuis cepat sejarah perkembangan komputer

University

10 Qs

Quiz EMR_Pertemuan 11

Quiz EMR_Pertemuan 11

University

10 Qs

Additional Excercise (Network Layer) - Router, IPv4 and IPv6

Additional Excercise (Network Layer) - Router, IPv4 and IPv6

University

12 Qs

Kuis Webinar Cerdas Bertelekomunikasi OTP Fraud

Kuis Webinar Cerdas Bertelekomunikasi OTP Fraud

6th Grade - Professional Development

10 Qs

CHAPTER 1: COMPUTER SECURITY REVIEW

CHAPTER 1: COMPUTER SECURITY REVIEW

University

10 Qs

1-基本数据类型

1-基本数据类型

University

10 Qs

Basic on Operating System

Basic on Operating System

University

10 Qs

Quiz Webinar GNS3

Quiz Webinar GNS3

10th Grade - University

13 Qs

Python for loop

Python for loop

Assessment

Quiz

Computers

University

Medium

Created by

Sherif Abdelhamid

Used 35+ times

FREE Resource

AI

Enhance your content in a minute

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

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

An infinite loop is :A loop runs infinite times when the condition-------------.

never fails

run one time

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

In programming, what is iteration/looping?

The repetition of steps within a program

The order in which instructions are carried out

A decision point in a program

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

numbers = [5, 14, 9, 17]

for number in numbers:

if number % 3 == 0:

print(number)


The output will be?

17

9

14

9

17

14

17

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

numbers = [5, 14 ,9, 17]

for number in numbers:

if number >= 9:

print (number)


The output will be?

17

9

14

9

17

14

17

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How many times does the following program print the word ‘computer’:

word= "computer"  
for num in range(1,6):
 
    print(word)

5
6
1
0

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following for loops would print the following numbers?

3

5

7

9

for i in range(3, 10, 2):

print(i)

for i in range(3, 9, 2):

print(i)

for i in range(9):

print(i)

for i in range(3,9):

print(i)

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Three of the for loops below will provide identical values for i. Which for loop will provide values that do not match the others?

for i in range(0, 5):

for i in range(5):

for i in range(0, 5, 1):

for i in range(5, 0, 1):

8.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What would be the output of the following code:

for i in range(3):

print(5)

0 1 2

3 3 3 3 3

5 5 5

0 1 2 3 4