5 Respuestas
+ 5
D'lite Easy yes, but not good style.
Rather use better describing variable names or extend them a bit.
Like costume_print, myPrint, etc.
Otherwise it's a likely error source, especially when it comes to multiple programmers or revisiting an old code
+ 2
In general, don't use keywords as variables. Like print, class, etc...
+ 2
chandrapal singh
Easiest way to use reserved words is to change their case.
example : if -> IF
print --> Print
https://code.sololearn.com/cdeElXd6S23S/?ref=app
+ 1
I think in this case, your only solution is to use "namespaces" concept to be able to preserve your variable name.
+ 1
D'lite , chandrapal seems to have changed the case already (the heading and the description are a little contradictory). The problem may also lie elsewhere.
chandrapal singh , would you mind sharing your code so we can take a closer look? Thanks!