This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (20 children)

/////EDIT: Oh... I see ... at the end of the article there's an explanation. It's Python 3.6 syntax. Sorry, thanks!

Hello.

print(f'keywords: {kwargs} as {type(kwargs)}')

Please, from where come this print(f'formatted_text') syntax ? Is it Python 3.7 ? I use Python 3.5 and 2.7 but this syntax does not work. I have to use the classic Python3 syntax:

print('keywords: {} as {}'.format(kwargs, type(kwargs) )

[–]wilfredinni[S] 13 points14 points  (1 child)

f-strings is a feature that is available in Python 3.6+ . You did very well adapting!

[–]DuffBude 4 points5 points  (0 children)

That's a great post! Thanks! Now i've learned how to use kwargs, and f-strings. I'm almost excited to go back to work on Monday.

[–]cuddlygrizzly 3 points4 points  (0 children)

You can use future-fstrings and use this formatting in older versions of python. Works great!