1# If you want to use repr in f-string use "!r"
2# Normal behavior (using str)
3>>> color = "blue\ngreen"
4>>> day = datetime.date(2020, 6, 4)
5>>> f"Color is {color} and day is {day}"
6'Color is blue\ngreen and day is 2020-06-04'
7# Alternate behavior (using repr)
8>>> f"Color is {color!r} and day is {day!r}"
9"Color is 'blue\\ngreen' and day is datetime.date(2020, 6, 4)"
1>>> name = "Eric"
2>>> age = 74
3>>> f"Hello, {name}. You are {age}."
4'Hello, Eric. You are 74.'
5
1#python3.6 is required
2age = 12
3name = "Simon"
4print(f"Hi! My name is {name} and I am {age} years old")