Question 1
You could pass the function that return user input directly into the calculate function
these should be changed into one function that takes the string as input.
so you could remove the functions and just use
Question 2
When you don't use parentheses a function is not run, this is useful because then a function can be passed around to other functions and then called at another point.
You could pass the function that return user input directly into the calculate function
calculate_result(get_user_input_1(), get_user_input_2())note as your
get_user_input
functions are basically the same apart from the string that the user sees(also the numbering 1 & 2 is usually a telltale sign)these should be changed into one function that takes the string as input.
def user_input(prompt): return input(prompt)you can create constants for the user input prompts
PROMPT_1 = "Type a number: " PROMPT_2 = "Type another number to multiply by your first number: "and then the
calculate_result
call would becalculate_result(user_input(PROMPT_1), user_input(PROMPT_2))Then you see that your function is not actually adding anything to the built-in
input
so you could remove the functions and just use
calculate_result(input(PROMPT_1), input(PROMPT_2))Note you would also likely want to add to the user_input function to say validate the input and then the function would be worth having.
Question 2
When you don't use parentheses a function is not run, this is useful because then a function can be passed around to other functions and then called at another point.