Search Header Logo

Python Quiz

Authored by Raymond Radebe

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

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to initialize a list in Python?

list = [1, 2, 3]

list = (1, 2, 3)

list = {1, 2, 3}

list = 1, 2, 3

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code:

print(type(3/2))?

<class 'int'>

<class 'float'>

<class 'str'>

<class 'complex'>

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to define a function in Python?

func

function

define

def

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to add an item to a list in Python?

add()

insert()

append()

push()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of print(2 ** 3)?

6

8

9

12

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following functions converts an object to a string in Python?

str()

int()

chr()

repr()

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of print(4 // 2)?

2.0

2

4.0

4

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?