+ 1
python print format
print("I said: %r.". % x) ^ SyntaxError: invalid syntax I have a SyntaxError for this, what did I do wrong here?
4 Respostas
+ 10
print("I said {}".format("hello"))
You can use this.😊😊
+ 7
You can check this
https://pyformat.info/
+ 1
Thanks.
I can use that but I want to know that did I go wrong with the first code?
0
Could be the period / decimal inside the quotes unless your goal was for that to print as well
{%r.".} != {%r".}