Python: % operator in print() statement
python, syntax
Solution
`'(%g,%g)'` is the template and `(blank.x,blank.y)` are the values which need to be filled in place of `%g` and `%g` and `%` operator does just that. Its called String interpolation or formatting operator.
Problem
I just came across this Python code, my question is about the syntax in the print statement: ``` class Point(object): """blub""" #class variables and methods blank = Point blank.x = 3.0 blank.y = 4.0 print('(%g,%g)' % (blank.x,blank.y)) ``` This print statement simply prints (3.0, 4.0), i.e. the values in blank.x and blank.y. I don't understand the % operator in front of the (blank.x, blank.y) in the last line. What does it do and where can I find it in the documentation? Googling this, I always end up with the modulus operator.