Cloud Stack Ninja

def userChoice():
    print("Press 1 to send text message\n Press 2 to share file")
    action = int(input("Please what do you want to do ? "))
    return action


def useValue():
    value=userChoice() + 1
    print(value)

userChoice()
useValue()

""" I discovered the second function asks for User input again whereas I don't want that, instead I just need the value already given by the user in the first function """



Read more here: https://stackoverflow.com/questions/64190249/if-a-function-returns-a-value-entered-by-a-user-how-can-i-use-that-value-in-ano

Content Attribution

This content was originally published by Simeoni at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: