-
-
Save IndhumathyChelliah/19af13861cadc8c5d33c566515e794ad to your computer and use it in GitHub Desktop.
This file contains 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
#default arguments | |
s1="Hello {},I like to learn {}".format("Karthi","Python") | |
print (s1)#Output:Hello Karthi,I like to learn Python | |
#positional argumenst | |
s2="Hello {0},I like to learn {1}".format("Karthi","Python") | |
print (s2)#Output:Hello Karthi,I like to learn Python | |
s3="Hello {1},I like to learn {0}".format("Python","Karthi") | |
print (s3)#Output:Hello Karthi,I like to learn Python | |
#keyword arguments | |
s4="Hello {name},I like to learn {language}".format(language="Python",name="Karthi") | |
print (s4)#Output:Hello Karthi,I like to learn Python |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment