Exercise:06 Python variable and Its types
Other variable types
In the previous exercise, you worked with two Python data types:
int
, or integer: a number without a fractional part.savings
, with the value100
, is an example of an integer.float
, or floating point: a number that has both an integer and fractional part, separated by a point.growth_multiplier
, with the value1.1
, is an example of a float.
Next to numerical data types, there are two other very common data types:
str
, or string: a type to represent text. You can use single or double quotes to build a string.bool
, or boolean: a type to represent logical values. Can only beTrue
orFalse
(the capitalization is important!).
Comments
Post a Comment