variable = "Hello World" print(variable)
name = "Bob" print(f"hello {name}!")
var = "Python printing is amazing!" print(var)
print("If there was a birth every 7 seconds, there would be: {} births".format(births))
name = "Steven" # Using f-strings print(f"Hi, {name}!") # Using format() print("Hi, {}!".format(name))
>>> print("{:d} {:03d} {:>20f}".format(1, 2, 1.1)) 1 002 1.100000 ^^^ 0's padded to 2
>>> print("foo", "bar", "spam") foo bar spam
str1 = "Hello World" print(str1)
print("If there was a birth every 7 seconds, there would be: ", births, "births")