22 lines
468 B
Python
Executable File
22 lines
468 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))
|