Files
Python-HV/Pass1/Datatypes.py
2018-02-22 14:42:33 +01:00

21 lines
465 B
Python
Executable File

#Python is a dynamically typed language. Python uses values not variables :)
a = 100
b = "foo"
c = True
d = 10.95
e = "bar"
# b is changed from string to integer dynamically
b = 4
print(a)
print(b)
print(c)
print(d)
print(a+d)
#bunch of different ways to concatenate different datatypes, format is recommended I believe
print(str(a)+e)
print(a,e)
print("Concatenate: {} {}".format(a,e))
print("Concatenate: {} {}".format(a,c))
print("Concatenate: %d %s " % (a,e))