Back to Freecodecamp

Step 4

curriculum/challenges/english/blocks/learn-special-methods-by-building-a-vector-space/65f056a405239e1dc4cc2854.md

latest462 B
Original Source

--description--

Now, assign y to the y attribute of the Vector object.

--hints--

You should assign y to self.y.

js
({
    test: () => assert(runPython(`
      _Node(_code).find_class("Vector").find_function("__init__").find_variable("self.y").is_equivalent("self.y = y")
    `))
})

--seed--

--seed-contents--

py
--fcc-editable-region--
class Vector:
    def __init__(self, x, y):
        self.x = x
--fcc-editable-region--