0
What is wrong with this code and why do i get the error "NameError: name 'arg' is not defined"?
This is probably a noob problem but all help and explanations are greatly appreciated :) https://code.sololearn.com/cduz0iHUqhMi/?ref=app
3 Réponses
+ 3
Def should be def.
Print should be print.
(no caps).
Watch out with the indentation too, it's hard to tell what's in the function and what isn't. Python sort of relies on proper indentation.
Writing "impure(arg)" to call the function will throw an error since arg isn't defined.
+ 1
Also Some_list is not some_list in Python!!! Python is case-sensitive!
+ 1
Thanks guys :) the reason for the difference in caps was just changed by default on my phone, but thanks anyway for the advice and to James for the correct code :)