Check your understanding of the previous reading on types.

Question 1

Identify the type of each literal value.

LiteralType
5
False
4.3
"Hello World"
"4"
""
None
0
"True"

Question 2

Match each type to its description.

TypeDescription
Integer
String
Float
None
Boolean
Python

Question 3

Which of the following are Integers, in Python?

Select every Integer literal, then check.

  • Yes. A whole number, no quotes, no decimal point: an Integer.
  • No. It is inside quotation marks, so it is a String, even though it spells out a number.
  • No. Quotation marks make this a String, not the Integer 7.
  • No. It has a decimal point, so it is a Float.
  • No. Even though it represents a whole amount, the decimal point makes this a Float, not an Integer.
  • Yes. A large negative whole number, still an Integer - size and sign don't change the type.

Question 4

Write the output of the print statement:

print("5")

What does print("5") write to the console?

Show explanation

"5" is a String literal - the quotes are part of the code, not part of the value. Printing it shows only the character 5, with no quotes around it.

Question 5

How many possible values are there for each type?

TypePossible values
Integer
Boolean
String
Float
None

Question 6

Match each type to its abbreviation in Python:

TypeAbbreviation
Integer
None
Boolean
String