[Solved] Why does return not return my Variable?


I think you miss a return in the first function

def get_input(high_run, low_run, run):
    pressed_key = input('')

    if pressed_key == "n":  # Next Page
        return set_high_run_np(high_run, run), set_low_run_np(low_run, run)

def set_high_run_np(high_run, run):
    if high_run != len(ldata):
        high_run = high_run + run

    return high_run

def set_low_run_np(low_run, run):
    if low_run != len(ldata) - run:
        low_run = low_run + run

    return low_run

I added the return. I chose to return a tuple of values which in python is done with a comma. But there are a lot of other ways you can choose to return the values, you just need to return them.

11

solved Why does return not return my Variable?