This is a pretty choppy way to do this but I'm not sure why you set the value of num to 0 and then added 1 to it before even checking to see if it equals to 0 first. I rewrote what I (think?) you originally meant:
def running_average(): total = 0 num_values = 0 average = 0 while True: value = input("Enter an integer: ") if value == "done": break else: total += int(value) num_values += 1 average = total / num_values return average #print(running_average())When it says you should initialize your return value to 0, it doesn't mean to literally return 0, but instead, you see how you're returning running_average? What it means is in your first declaration of running_average, you should set it to 0.