Python Data Types Quiz

Python Data Types Quiz

12th Grade

10 Qs

quiz-placeholder

Similar activities

Name That Logo!

Name That Logo!

9th - 12th Grade

13 Qs

AL-(S)

AL-(S)

12th Grade

10 Qs

Logo guessing game

Logo guessing game

12th Grade

10 Qs

Understanding Lists and Strings

Understanding Lists and Strings

9th - 12th Grade

15 Qs

Python Pretest

Python Pretest

9th - 12th Grade

15 Qs

List quiz1

List quiz1

9th - 12th Grade

10 Qs

Technology Takes Over

Technology Takes Over

9th - 12th Grade

10 Qs

Tutor Quiz 01/03/24 St David's Day

Tutor Quiz 01/03/24 St David's Day

9th - 12th Grade

15 Qs

Python Data Types Quiz

Python Data Types Quiz

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Haden Hiser

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a text type in Python?

dict

list

int

str

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to print the data type of variable x if x = 5?

print(x.type())

print(x.dtype())

print(type(x))

print(dtype(x))

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct way to set a variable x to a list?

x = ("apple", "banana", "cherry")

x = ["apple", "banana", "cherry"]

x = {"apple", "banana", "cherry"}

x = "apple, banana, cherry"

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a boolean type in Python?

1

None

0

True

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you specify the data type of a variable x to be a dictionary?

x = {"John", 36}

x = {"name" : "John", "age" : 36}

x = ["name" : "John", "age" : 36]

x = dict(name="John", age=36)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a binary type in Python?

str

int

list

bytes

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to set a variable x to a frozenset?

x = {"apple", "banana", "cherry"}

x = ("apple", "banana", "cherry")

x = frozenset(["apple", "banana", "cherry"])

x = ["apple", "banana", "cherry"]

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?