So I am new to class in Python but not new to classes in general. I want to generate a new number in the object I create, and constantly change it.
So I did
class ArmedBandit1:
num = 0
def spin():
num = random(10)
a1 = ArmedBandit1()
a1.spin()
print(a1.num)
Now I get an error
Traceback (most recent call last):
File "main.py", line 9, in <module>
a1.spin()
TypeError: spin() takes 0 positional arguments but 1 was given
But I didn't give it any arguments, and if I try to remove the "()" it ignores the method.