f strings shortcut python code example
Example 1: python fstring
#python3.6 is required
age = 12
name = "Simon"
print(f"Hi! My name is {name} and I am {age} years old")
Example 2: how to pass in f string python
>>> f"{{70 + 4}}"
'{70 + 4}'
#python3.6 is required
age = 12
name = "Simon"
print(f"Hi! My name is {name} and I am {age} years old")
>>> f"{{70 + 4}}"
'{70 + 4}'