Is there a way to return user_input_1 and user_input_2 into the function_3 without using temp_var_1 and temp_var_2 and insert it directly?
What is the correct way of doing it?
def function_1():
user_input_1 = input("\nInput the first word: ")
return user_input_1
def function_2():
user_input_2 = input("\nInput the second word: ")
return user_input_2
def function_3(user_input_1,user_input_2):
user_input_total = user_input_1 + user_input_2
print(user_input_total)
def main():
temp_var_1 = function_1()
temp_var_2 = function_2()
function_3(variable_1,variable_2)
main()
This is not working.
def function_1():
user_input_1 = input("\nInput the first word: ")
return user_input_1
def function_2():
user_input_2 = input("\nInput the second word: ")
return user_input_2
def function_3(user_input_1,user_input_2):
user_input_total = user_input_1 + user_input_2
print(user_input_total)
def main():
function_1()
function_2()
function_3(function_1,function_2)
main()