Loops, Functions, and Conditions Basics

Loops, Functions, and Conditions Basics

University

20 Qs

quiz-placeholder

Similar activities

JAVA Basics Quiz

JAVA Basics Quiz

University

20 Qs

Python modules, operators and random

Python modules, operators and random

University

15 Qs

Mastering Python Loops and Functions

Mastering Python Loops and Functions

10th Grade - University

20 Qs

Geeks for Geeks PCCOER Info Session CP Quiz

Geeks for Geeks PCCOER Info Session CP Quiz

University

20 Qs

Python Basic Quiz 01

Python Basic Quiz 01

University

17 Qs

Python MCQ

Python MCQ

University

20 Qs

PROGRAMMING IN PYTHON - UNIT II - TEST 2 - MCQS

PROGRAMMING IN PYTHON - UNIT II - TEST 2 - MCQS

University

15 Qs

ASK F2 -KOD ARAHAN (PYTHON)

ASK F2 -KOD ARAHAN (PYTHON)

1st Grade - University

15 Qs

Loops, Functions, and Conditions Basics

Loops, Functions, and Conditions Basics

Assessment

Quiz

Computers

University

Hard

Created by

Abdullah Muhammad 201-801-271

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop is guaranteed to execute at least once in Python?

for

while

do-while

repeat-until

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for a for loop in Python?

for variable in iterable:

for variable of iterable:

foreach variable in iterable:

for variable -> iterable:

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you terminate a loop prematurely in Python?

continue

break

return

stop

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the continue statement do in a loop?

Exits the loop completely

Skips the rest of the code inside the loop for the current iteration and proceeds to the next iteration

Restarts the loop

Pauses the loop execution

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? for i in range(3): print(i,end='')

012

123

0123

01234

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default return value of a function if no return statement is used?

None

0

'' (empty string)

False

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you define a function in Python?

function name(parameters):

def name(parameters):

define name(parameters):

func name(parameters):

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?