string f ptyhon code example
Example 1: python f string
>>> name = "Eric"
>>> age = 74
>>> f"Hello, {name}. You are {age}."
'Hello, Eric. You are 74.'
Example 2: how to pass in f string python
>>> f"{{70 + 4}}"
'{70 + 4}'
>>> name = "Eric"
>>> age = 74
>>> f"Hello, {name}. You are {age}."
'Hello, Eric. You are 74.'
>>> f"{{70 + 4}}"
'{70 + 4}'