Solution: What is %s in Python 3

Development | Programming languages
  • 5.0 (2 ratings)
Last updated 11/2018
What is %s in Python 3..?
No attachments.
It is a string formatting syntax (which it borrows from C).
name = "John"
print("hello %s" % (name,))
name = "John"
surname = "Smith"
age = "37"

print("%s %s %s\n" % (name, surname, age))

on November 19th, 2018 (9:33 pm)
What masters said
You must sign in to comment!!
All comments
Thank you very much for the explanation.
on November 19th, 2018 (9:37 pm)
Good explanation.
on November 20th, 2018 (11:01 pm)
Good work. Thank you.
on January 01st, 2019 (5:41 pm)