Python – print(f’stuff {functions}’) noob fun

Little things are fun to me, like using print() with the ‘f’ formatting feature. This allows you to parse variables and something I just found out today do calculation’s within the print() function. Yea it’s so simple but I didn’t know all of the capabilities. Now I am like “what else can it do”?????

website = 'dreamcreator.io'
print(f'{website} is my website, and I like to improve my math like 8042 / 66 = {round(8042 / 66)}')

# Result
dreamcreator.io is my website, and I like to improve my math like 8042 / 66 = 122

#check this out too sep='' argument is super handy
print('bro','are we','there yet?', sep='\n')

# Result
bro
are we
there yet?

Leave a Comment