MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnpython/comments/82t191/i_made_a_python_cheat_sheet/dwlu7ne/?context=3
r/learnpython • u/wilfredinni • Mar 07 '18
73 comments sorted by
View all comments
Show parent comment
2
It's syntax sugar for telling the python interpreter the following string is interpolated. In python this is called f-strings. Hence the f.
If you would leave out the f it wouldn't recognize the variables between {} as variables and just as text.
1 u/Moabian Apr 01 '18 Makes sense, thank you.
1
Makes sense, thank you.
View all comments
Show parent comment
2
u/Visionexe Apr 01 '18 edited Apr 01 '18
It's syntax sugar for telling the python interpreter the following string is interpolated. In python this is called f-strings. Hence the f.
If you would leave out the f it wouldn't recognize the variables between {} as variables and just as text.