0

I'm studying Python with Tutorials Point and I didn't understand why the % operator is used here:

print "My name is %s and weight is %d kg!" % ('Zara', 21)

I mean the one before the parenthesis. Thanks for the help!!

Guru
  • 2,331
  • 6
  • 31
  • 48
  • 2
    "I'm studying Python with Tutorials Point and I didn't understand why" Well, what does the other text on the web page that you were reading, say about it? Did you think that something else should be used there instead? If so, why, and what? Also: Please try to find a more up to date tutorial. This code will only work with Python 2, which has been unsupported for over 2 years (it is comparable to using Windows 7 to run your computer). – Karl Knechtel Jun 26 '22 at 23:55
  • 1
    @Mark I think the question is about the actual operator, not the string placeholders. It's hard to say anything useful in response to such a question, though. – Karl Knechtel Jun 26 '22 at 23:56

0 Answers0