Search Header Logo

Python Quiz (part 1)

Authored by Adam Ricketts

Computers

9th - 12th Grade

Used 2+ times

Python Quiz (part 1)
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct variable assignment in Python?

int number = 5
5 = number
number = 5
number == 5

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What data type is the following value: 3.14?

int
str
list
float

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

my_var
_variable
2ndVar
var-name

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the data type of the variable result after the following operation? result = 10 / 3

int
str
float
list

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you define a string variable in Python?

name = 'Alice'
name = Alice
name : 'Alice'
name == 'Alice'

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to initialize a list in Python?

list = {}
list = []
list = ''
list = ()

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function is used to determine the data type of a variable?

datatype()
typeof()
print()
type()

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?