Jan-18-2019, 12:41 PM
Hello,
I am trying to make an __init__ function's argument be the previous argument of that function divided by 2.
Any other ways to do it?
I am trying to make an __init__ function's argument be the previous argument of that function divided by 2.
class item: def __init__(self,value1,value2): self.v1 = value1 self.v2 = value2 x = item(10,item.v1/2)However, when I run it I get the message that "type object 'item' has no attribute v1".
Any other ways to do it?