Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created June 29, 2020 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IndhumathyChelliah/19af13861cadc8c5d33c566515e794ad to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/19af13861cadc8c5d33c566515e794ad to your computer and use it in GitHub Desktop.
#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