Skip to main content
Contents
Search Book
Search Results:
No results.
Readability settings Prev Up Next Scratch ActiveCode Profile
title here
\(
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
Section 16.6 Review - Data Types
Practice identifying common Python data types and understanding how data types affect what operations can be performed.
Subsection 16.6.1 Quick Reference
Common data types in we covered include
int for whole numbers,
float for decimal numbers,
str for text in quotes,
bool for
True or
False, and
list for collections of values.
Subsection 16.6.2 Part A: Identify the Data Type
Checkpoint 16.6.1 .
For each value, write its data type:
int,
float,
str,
bool, and
list.
7
3.14
"hello"
True
[1, 2, 3]
"42"
False
9.0
Subsection 16.6.3 Part B: Predict What Happens
Checkpoint 16.6.2 .
For each expression, decide what the result is or whether it causes an error.
5 + 3
"hi" + "there"
"hi" * 3
5 + "3"
10 / 2
True + 1
[1, 2] + [3, 4]
Subsection 16.6.4 Part C: Fix the Type Problem
Checkpoint 16.6.3 .
Rewrite the code so it works correctly.
Checkpoint 16.6.4 .
Rewrite the code so it works correctly.
Checkpoint 16.6.5 .
Rewrite the code so it works correctly.
Subsection 16.6.5 Part D: Create
Checkpoint 16.6.6 .
Write one variable that stores an
int, one that stores a
float, one that stores a
str, one that stores a
bool, and one that stores a
list.
Subsection 16.6.6 Think About ...
Checkpoint 16.6.7 .
Why is it important for a programmer to know the data type of a value?
You have attempted
of
activities on this page.