fb_pixel

What is %s in Python 3

Development | Programming languages
Description
What is %s in Python 3..?
Attachments
No attachments
Info
Description
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)
All coments
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)