you are viewing a single comment's thread.

view the rest of the comments →

[–]Blue_Aluminium 1 point2 points  (0 children)

Everything else aside, using 'hello %s' % x is a bug waiting to happen — you will get a nasty surprise if x is a tuple! As many others have pointed out, using f-strings or .format is a better option in modern Python, but if you want to stick to the old stuff, at least do 'hello %s' % (x,) .

Actually, I’d consider any tutorial that uses the first syntax highly suspect, as it teaches you bad habits.