I am learning python and trying to have a generic way to force people to choose an option. I want to eventually make it more modular so that I can call it with choice(variable) and set choice(chosen). However, I am not doing well with boolean logic and if statements. Or 'return' and 'chosen()' just override for some reason.
Not sure why this will 'return' even if you type 'j' instead of 'left' or 'right' during input.
def choice():
chosen = input('Do you want to go left or right? (only type left or right): ').lower()
chosen == 'left' or 'right'
if True:
return chosen
if False:
choice()