Okay! Just like there are various types of cells in Excel (numbers, dates, text, etc.), there are various types of variables in Python. These include:
int) - integer numbers
current_age = 5
float) - numbers with a decimal part introduced after a dot (
current_weight = 75.5
string) - text values surrounded by single (
' ') or double (
" ") quotes:
standard_greeting = 'My name is Tom!'
Unlike many other programming languages, Python automatically detects the type of variable it should use. For instance, if you type:
temperature = 36.6
Python will know the temperature variable is a float because the number contains a dot (
.). Take a look at another example:
ratio = 250/100
In this case Python will automatically detect that the result of division is a floating point number.