+ 2
Sololearn can execute it, but, PyCharm fails! why?
exact same code, while running on PyCharm showed " TypeError : Vector2D class takes no arguement ", please, explain anyone! https://code.sololearn.com/cnfwy9d61QCH/?ref=app
2 Answers
+ 1
You may need to import the math module.
import math
Sandboxes such as codeplayground usually have something happening behind the scenes to make things work where they other wise wouldn't. If you're using an Ide make sure you have the proper modules imported.
0
' import math ' isn't working, same error message! PyCharm shows a warning at line 6 ( see my code bit ), ' wanring : unexpected arguemant ' for Vector2D() class, that is, Vector2D(self.x + other.x, self.y + other.y )...