def mod30(n):
if n >= 30:
return n - 30
else:
return n
def mod40(n):
# Use an if-statement to return the correct value.
if (n >= 40):
n = n - 40
return n
while True:
time = hero.time
x = mod30(time) + 25
y = mod40(time) + 10
hero.moveXY(x, y)
Every time I start my code it says
Thanks, @Jake_Doggy
While not required in PY, it can help group statements…it is typically used for clarity and ease of reading. Otherwise, since multiplication and division is performed before addition and subtraction, brackets can be used to circumvent this rule. Example: