Search Header Logo

Python Basics Quiz

Authored by Hamza Motiyar

Other

9th Grade

Used 1+ times

Python Basics Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

14 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to assign a value to a variable in Python?

x

#

/* */

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does len("hello") return?

4

5

6

Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you take user input in Python 3?

input()

readline()

raw_input()

scanf()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of: python Copy Edit x = 5 y = 2 print(x // y)

2.5

2

3

1

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a list in Python?

{1, 2, 3}

(1, 2, 3)

[1, 2, 3]

1, 2, 3

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to define a function in Python?

function myFunc():

def myFunc:

define myFunc():

def myFunc():

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does this loop do? python Copy Edit for i in range(3): print(i)

Prints 1 to 3

Prints 0 to 3

Prints 0, 1, 2

Prints 1, 2, 3

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?