1Python Variables are like boxes that store some values
2
3Example of delcaring a variable:
4
5number = 1
6name = "Python"
7isUseful = True
8number_2 = 1.5
1# Variables in Python are used to store some data in it and use it over and
2# over again
3# Variables can store Strings, Integers, Floats, Booleans
4var_string = "Hello World!"
5var_integer = 1234567890 # any number
6var_float = 3.14159 # any number with decimal value
7var_boolean = True # True or False
8
1variable1 = "value" # string
2variable2 = 1000000 # integer
3variable3 = 10000.0 # real/float
4variable4 = True # boolean: True or False
1# Like other languages such as Java or C++, You do not need to specify the
2# data type of a variable in Python. You first tyoe the variable name
3# and speciify the value with an equals sign. Example:
4num = 10
5print(num) # Output is 10
6
7num = 3.142
8print(num) # Output is 3.142
9
10num = "Hello World"
11print(num) # Output is Hello World
12
13num = True # You can set this to True or False, but the first character has to be capitalized.
14print(num) # Output is True