Feb-10-2019, 08:30 PM
hm, that is strange. The actual error I get is
then the code will run, but in order to see the output of Circum, you need to add print()
e.g.
Error:Traceback (most recent call last):
File "/home/boyan/sandbox/classes/enemy.py", line 11, in <module>
mycircle=Circle()
File "/home/boyan/sandbox/classes/enemy.py", line 5, in __init__
self.area=pie*radius*radius
NameError: name 'pie' is not defined
you can fix that by changing it to self.pie
then the code will run, but in order to see the output of Circum, you need to add print()
e.g.
print(mycircle.Circum())
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs