I have a function in which i get 2 numbers and add 75 to it, i dont want the resultant number to exceed 275, is there a python function that can do this for me, the code is like below,
def newnumber(num1,num2):
numbers = num1+num2+75
if numbers >275:
numbers = numbers - 275;
else:
numbers
return numbers
Above code just does it once, i want it sort of looped or if there is any python builtin function that can do this, it will be helpful
>Solution :
Did you mean to use a while loop?
def newnumber(num1, num2):
numbers = num1 + num2 + 75
while numbers > 275:
numbers -= 275
return numbers