Beginning Python Programming
Makzan, 2020 April.
# Defining variables
a = 1
b = 2
c = a + b
print(c)
print(b - a)
name = "Python"
# Concat string together
print("Hello" + name)
# Result:
> HelloPython
name = "Python"
# Concat string together
print("Hello" + name)
# Result:
> Hello Python
name = "Python"
print("Hello {}".format(name))
name = "Python"
print(f"Hello {name}")
temperture = 28
weather = "sunny"
# Concat strings together
print("It is " + weather + " today, " + str(temperture) + " Celsius degrees.")
😨
temperture = 28
weather = "sunny"
# Concat strings together
print("It is {} today, {} Celsius degrees.".format(weather, temperture))
😄
temperture = 28
weather = "sunny"
# Concat strings together
print(f"It is {weather} today, {temperture} Celsius degrees.")
😎