Aug-30-2021, 05:54 AM
(This post was last modified: Aug-30-2021, 05:55 AM by naughtyCat.)
your code is incorrect
def get_user_input_1(): user_input = input('Type a number: ') return user_input # here got return def get_user_input_2(): user_input = input('Type another number to multiply by your first number: ') return user_input # here also got return def calculate_result(x, y): if x or y != 'q': x = int(x) y = int(y) result = x * y print(result) get_user_input_1() # Where is the return value? get_user_input_2() # here also calculate_result(get_user_input_1, get_user_input_2) # get_user_input_1 and get_user_input_2 is function not variableshould be
def get_user_input_1(): user_input = input('Type a number: ') return user_input def get_user_input_2(): user_input = input('Type another number to multiply by your first number: ') return user_input def calculate_result(x, y): if 'q' not in (x or y): x = int(x) y = int(y) result = x * y print(result) x = get_user_input_1() y = get_user_input_2() calculate_result(x, y)