This is my code:
class test(object):
"""\
given angle is within 360 degrees"""
def __init__(self, angle):
self.angle = angle
def __str__(self):
return "This is going to be positive {}".format(self.angle)
def __neg__(self):
"""\
when given a negative angle it will be translated into a positive"""
if self.angle < 0:
return test(self.angle + 360)
angle = test(-100)
print(angle)
The output is:
This is going to be positive -100
How would I go about getting an angle of 260 instead of this negative? I'm stumped.