This is the entire code resolved. I will leave the answer here. Sorry for being late!
def calc(n): i = 1 total = 0 if (1 <= n <= 100): for i in range(1, n+1, 4): aux = i**2 total = aux + total else: total = -1 return total; # Program num=int(input("Input number ")) sum = calc (num) if (sum==-1): print("The number is not in range") else: print("The total of the calc is: ", sum)