Python 3.6 has a nice new feature:
formatted string literals.
You can insert in string text variables like this
>>> a = 100
>>> print(f'What will you get if you add 50 to {a}? Yes, you will have {a + 50}')
'what will you get if you add 50 to 100? Yes you will have 150'
formatted string literals.
You can insert in string text variables like this
>>> a = 100
>>> print(f'What will you get if you add 50 to {a}? Yes, you will have {a + 50}')
'what will you get if you add 50 to 100? Yes you will have 150'
Comments
Post a Comment