print=1 print(print)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

print=1 print(print)?

it gives me error massages when trying to define "print" is it possible to treat "print" as simply letters like "x"?

5th Mar 2017, 5:37 PM
Lokvrm
3 Answers
+ 1
yeah, but you won't be able to print anything in all scopes included in the one you have defined print as 1...
5th Mar 2017, 5:54 PM
Amaras A
Amaras A - avatar
+ 1
yeah I could't print anything after I did this until I del print why is that ? thanks
5th Mar 2017, 6:30 PM
Lokvrm
+ 1
Well your overriding the print method if you need to print stuff later you can store method in variable like this. joe = print print = "joe" joe(print)
5th Mar 2017, 6:38 PM
Paul
Paul - avatar