Ad
  • Custom User Avatar
  • Custom User Avatar

    magnitude should be a property and not a method

  • Default User Avatar

    I have passed all tests except for the magnitude test and am getting the error shown below. My magnitude function works in my personal test, but the error seems to have an issue with the test input. Can anyone provide some insight?

    Traceback (most recent call last):
    File "/runner/frameworks/python/cw-2.py", line 111, in wrapper
    func()
    File "main.py", line 104, in _
    test.assert_approx_equals(Vector(examples[0][:]).magnitude, 3.741, 0.001)
    File "/runner/frameworks/python/cw-2.py", line 84, in assert_approx_equals
    div = max(abs(actual), abs(expected), 1)
    TypeError: bad operand type for abs(): 'method'