Search Header Logo

Python Quiz

Authored by Jibin Saji

Other

12th Grade

Python Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements will correctly print "Hello Python!" to the console?

print("Hello Python!")
display("Hello Python!")
show("Hello Python!")
echo("Hello Python!")

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to store the number 10 in a variable named x?

x = 10
10 = x
variable x = 10
set x to 10

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

name = input("Enter your name: ")

print("Hello",name)

name"
Hello, John
Hello,
Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the if statement in Python?

To create a loop that repeats code.
To define a new function.
To execute a block of code only if a certain condition is true.
To display output on the screen.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many times will the word "Python" be printed by the following code?

for i in range(3):

print("Python")

Zero
1.0
2.0
3.0

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a valid Python variable name?

my_variable
_score
2nd_number
userAge

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of 15 % 4 in Python?

3.0
2.0
1.0

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?