Py | SoloLearn: Learn to code for FREE!

+1

Py

Hi guys, Why does the code give an error? print("print("print")")

6/9/2019 7:33:03 AM

Lili

2 Answers

New Answer

+3

Try this instead : print("print('print')")

+9

print() expects a string "print("print")" is not a valid string because you use double quotes inside double quotes You can either escape the inner double quotes like this: print("print(\"print\")") or use double quotes within single quotes: print('print("print")') or the other way round: print("print('print')")