Python Programming Quiz

Python Programming Quiz

11th Grade

15 Qs

quiz-placeholder

Similar activities

Boolean Expressions

Boolean Expressions

10th - 12th Grade

16 Qs

For Loops in Python

For Loops in Python

10th - 11th Grade

18 Qs

Control Statements in Python

Control Statements in Python

11th Grade

20 Qs

Quiz 2: Introduction to PHP

Quiz 2: Introduction to PHP

11th Grade

10 Qs

Quiz on 19 Dec

Quiz on 19 Dec

11th Grade

10 Qs

Intro to Java Loops

Intro to Java Loops

9th - 12th Grade

15 Qs

Python Conditionals

Python Conditionals

9th - 11th Grade

17 Qs

Python Basics Review (TSK)

Python Basics Review (TSK)

9th - 12th Grade

20 Qs

Python Programming Quiz

Python Programming Quiz

Assessment

Quiz

Computers

11th Grade

Hard

Created by

Rajath Vijayakumar

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

0 1 2 3

1 2 3

0 1 2

Error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

while (condition) {}

while condition:

while: condition

while(condition):

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the break statement do in a loop?

Skips the current iteration

Exits the loop completely

Terminates the program

Repeats the loop

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? x = 10 if x > 5: print("Greater") else: print("Smaller")

Greater

Smaller

Error

None

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid Python if-else syntax?

if (condition): else:

if condition: else:

if condition: elif:

if condition: else:

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of this code? x = 5 if x < 10: if x % 2 == 0: print("Even") else: print("Odd") else: print("Greater")

Even

Odd

Greater

None

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the return statement do in a function?

Stops the function and returns a value

Outputs the value to the console

Iterates through the function

Restarts the function

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?