Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23160

Python string formatting [duplicate]

$
0
0

I'm studying the code of an open source project. The code it's written in python and unfortunately I'm not so experienced with it. I found a lot of statement in the code like this:

print "the string is %s" % (name_of_variable, )

I know that, similarly to c language, this is a way to properly format the output, but I really don't understand what is the meaning of the comma right after the "name_of_variable" within the parenthesis.

I searched through python documentation, but I didn't find nothing about that kind of statement. Does anyone know what is its meaning?


Viewing all articles
Browse latest Browse all 23160

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>