Format characters need not be specified?

0

Do the format characters have to be specified? such as:

x = "Get rekt m8"
print "Eu disse: %r." % x

So why did not I have to specify this one and it worked for me?

hilarious = False
joke_evaluation = "Isn't that joke so funny?! %r"
    
asked by anonymous 18.03.2015 / 17:45

1 answer

0

A string can be formatted at any time. The % character performs the formatting operation only when it is used as an operator. While this does not occur, the string in question can be manipulated and used without any problem.

link

Since Python 2.6, there is a more powerful way to format strings:

link

    
28.05.2015 / 00:32