Skip to content

Instantly share code, notes, and snippets.

@anandtripathi5
Created February 16, 2022 23:09
Show Gist options
  • Save anandtripathi5/8743e49809c1188bdb12f7001eb9df08 to your computer and use it in GitHub Desktop.
Save anandtripathi5/8743e49809c1188bdb12f7001eb9df08 to your computer and use it in GitHub Desktop.
Zen of python - There should be one - and preferably only one - obvious way to do it. Although that way may not be obvious at first unless you're Dutch.
# Using the % operator
proglang = "Python"
print('The Zen of %s' % proglang)
# Using the .format() method
my_str = 'The Zen of {}'
print(my_str.format(proglang))
# Using f-strings
print(f"The Zen of {proglang}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment