In [1]:
# How to create and give a name to an integer?
my_grade = 95

# How to create and give a name to a floating-point number?
my_account_balance = 10200.58

# How to create and give a name to a string?
my_favourite_language = 'python'
In [2]:
# How to print the values using the names?
print(my_grade)
print(my_account_balance)
print(my_favourite_language)
95
10200.58
python
In [3]:
# How to print the values directly?
print(95)
print(10200.58)
print('python')
95
10200.58
python
In [4]:
# How to print more informative statements?
print('My grade is',  my_grade, 'percent')
print('My account balance is', my_account_balance, 'dollars')
print(my_favourite_language, 'is awesome! It is my favourite programming languge')
My grade is 95 percent
My account balance is 10200.58 dollars
python is awesome! It is my favourite programming languge
In [5]:
# How to print the data types (or class) directly?
print(type(95))
print(type(10200.58))
print(type('python'))
<class 'int'>
<class 'float'>
<class 'str'>
In [6]:
# How to print the data types (or class) using the names?
print(type(my_grade))
print(type( my_account_balance))
print(type(my_favourite_language))
<class 'int'>
<class 'float'>
<class 'str'>