Search Header Logo

Python Quiz

Authored by Thanh Sơn Phạm

Information Technology (IT)

University

Used 1+ times

Python Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Media Image

What will be the output of this code in Python 3?

a) <class 'int'>

b) <class 'float'>

c) <type 'int'>

d) <type 'float'>

2.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Media Image

What is the result of the following code in Python 2?

a) <type 'int'>

b) <type 'float'>

c) Error

d) None

3.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Media Image

What will this code output?

a) 3

b) 3.3333...

c) 3.0

d) Error

4.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Which of the following is NOT a valid assignment in Python?

a) x = 1, 2, 3

b) x, y, z = 1, 2, 3

c) x = (y = 2)

d) x = y = z = 10

5.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Media Image

What will the following code output in Python 3?

a) Success

b) Failure

c) Error

d) None

6.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Media Image

What will this code output in Python 2?

a) True

b) False

c) Error

d) None

7.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Which of the following is a valid way to check for None in Python?

a) if x == None:

b) if x is None:

c) Both a and b

d) None of the above

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?