From the course: Introduction to Python: Learn How to Program Today with Python by Pearson
Unlock this course with a free trial
Join today to access over 25,400 courses taught by industry experts.
Learn about types - Python Tutorial
From the course: Introduction to Python: Learn How to Program Today with Python by Pearson
Learn about types
Okay, so one of the most basic concepts to start wrapping your head around with programming is the concept of types. And in Python, there's a bunch of types that we've seen already, but the reason there are different types is because there's different ways of storing data, different methods and and functions that can be used on different types of data. And yeah, it's just kind of grouped. I'm going back to the Python console here, and we've seen some types already. So for example, whole numbers are considered integers, okay? Whereas if they have a decimal place, they're now floats. And we can see the type of something by using the built-in type function, okay? So it's something that you can just use, like print. It's called type. We put parentheses afterwards and pass something in. And it'll return or print out what type it is. So this has the type of class int, which stands for integer. And then 1.0 is float. Other types that we've seen are characters. If it's in quotes, it's a…
Contents
-
-
-
-
(Locked)
Learning objectives51s
-
(Locked)
Learn about types6m 35s
-
(Locked)
Work with variables14m 9s
-
(Locked)
Debug errors15m 44s
-
(Locked)
Manipulate strings13m 10s
-
(Locked)
Write a Mad Libs program7m 14s
-
(Locked)
Use modules16m 32s
-
(Locked)
Write your own functions16m 7s
-
(Locked)
Write a timer game12m 19s
-
(Locked)
More context: Learn about Python11m 9s
-
(Locked)
-
-
-
-
-
-