1. data types

Data is at the core of everything we do in Python! Essentially, data is just a collection of information which may include numbers, words, or phrases. We use it to tell our computer what we want and how we want it.

In this video, we’ll be going over 4 basic data types in Python: booleans, integers, floats, and strings. We’ll also cover type casting.

Don’t worry if any of that sounds foreign to you! By the end of this video, you’ll be an expert!

agenda

  • what are data types?
  • practice with different data types
  • casting

slides worksheet 14 min
more practice
question #1

What data types would the following data be?

a) 32
b) 4.5
c) “hello!”
d) True
e) “9”
f) str(12.3)


a) int
b) float
c) string
d) boolean
e) string
f) string

question #2

What will be the output of the following code?

print(bool(1))
print(float(32))
print(int(False))
print(float(int(False)))
print(bool(int(0.5)))


True
32.0
0
2.0
False