Lesson 2
The Basic Elements
Chapter 4: Objects
Figure out the types!
What are the types of the following literals?
(A literal is a succinct and ‘direct’ way to write a value)
For each question, select the right answer (i.e. int
, float
, complex
, bool
, str
). Select Error
if you think it is an invalid literal.
Try to guess the answer first. Don’t worry, there is no penalty for any wrong answer! This is meant for you to explore and try things out! You can use type()
in an interactive Python prompt to confirm your guess if you wish.
Click “Check answer!” to verify your answer (explanations are also provided for some questions).
❮
❯