Created
February 16, 2022 23:09
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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