-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
Would it be beneficial to add f-strings to this cheat sheet? I hope this is not vastly out the website's focus.
>>> import datetime
>>> name = 'Fred'
>>> age = 50
>>> anniversary = datetime.date(1991, 10, 12)
>>> f'My name is {name}, my age next year is {age+1}, my anniversary is {anniversary:%A, %B %d, %Y}.'
'My name is Fred, my age next year is 51, my anniversary is Saturday, October 12, 1991.'
>>> f'He said his name is {name!r}.'
"He said his name is 'Fred'."
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels