Python Summer internship quiz 4

Python Summer internship quiz 4

University

10 Qs

quiz-placeholder

Similar activities

KUIS 5,6,7 PEMASARAN FARMASI

KUIS 5,6,7 PEMASARAN FARMASI

University

10 Qs

QUIZ SEMIOTICA_2CORTE

QUIZ SEMIOTICA_2CORTE

University

10 Qs

Kuis kelompok bermain

Kuis kelompok bermain

University

10 Qs

PRETEST P1 DASAR DASAR BAHAN ALAM

PRETEST P1 DASAR DASAR BAHAN ALAM

University

10 Qs

Quiz Milad YPSAF 32 Th

Quiz Milad YPSAF 32 Th

University

12 Qs

Сказка о рыбаке и рыбке

Сказка о рыбаке и рыбке

2nd Grade - University

12 Qs

Quản trị rủi ro doanh nghiệp

Quản trị rủi ro doanh nghiệp

University

10 Qs

rubiks cube quiz

rubiks cube quiz

KG - Professional Development

13 Qs

Python Summer internship quiz 4

Python Summer internship quiz 4

Assessment

Quiz

Other

University

Practice Problem

Hard

Created by

Gnaneshwar Reddy

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

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

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?
for i in range(3):

pass

print(i)

a) 0

b) 1

c) 2

d) 3

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the else clause in a loop in Python?

a) To execute a block of code after the loop finishes normally without hitting a break.

b) To execute a block of code after the loop finishes regardless of whether it hit a break or not.

c) To execute a block of code before the loop starts.

d) To execute a block of code only if the loop is infinite.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?
for i in range(5):

if i == 3:

continue

print(i)

  • a) 0 1 2

b) 0 1 2 3

c) 0 1 2 4

d) 0 1 2 3 4

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?
for i in range(5):

if i == 3:

break

print(i)

  • a) 0 1 2 3

b) 0 1 2

c) 1 2 3

d) 0 1 2 4

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following will result in an infinite loop?

a) for i in range(1, 10, 1): print(i)

b) while True: print("Hello")

c) while False: print("Hello")

d) for i in range(10): print(i)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many times will "Hello" be printed in the following code?
for i in range(3):

for j in range(3):

print("Hello")

  • a) 3

b) 6

c) 9

d) 12

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?
for i in range(3):

for j in range(2):

print(i, j)

  • a) (0, 0) (0, 1) (1, 0) (1, 1) (2, 0) (2, 1)

b) 0 0 0 1 1 0 1 1 2 0 2 1

c) (0, 0) (0, 1) (1, 0) (1, 1)

d) 0 0 1 1 2 2

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?