I have no idea what are you doing to get the error. The code you show does nothing because lines 4-6 are inside class you never use. Fix indentation and it works.
Here is the code in repl.it
Here is the code in repl.it
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