+ 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

12th Jun 2022, 4:37 PM
Anamitra Bera
Anamitra Bera - avatar
2 odpowiedzi
+ 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.
12th Jun 2022, 5:36 PM
Chris Coder
Chris Coder - avatar
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 )...
13th Jun 2022, 5:00 AM
Anamitra Bera
Anamitra Bera - avatar