You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Benjamin Loire edited this page Mar 30, 2023
·
1 revision
By convention, all strings should be in double quotes "" (single quotes will be blackened either way). If dynamic content is needed in a string, it should be formatted using f-strings like so:
foo="bar"baz=5print(f"The value of foo is {foo}, and baz is {baz}")
About any operation can go in the brackets, however you will need to use single quotes if you need a string there.
foo= ["bar","baz"]
print(f"The elements in foo are {','.join(foo)}.")