I am stuck on this homework problem. This is the assignment question and prompt:
"Define stubs for the functions get_user_num() and compute_avg(). Each stub should print "FIXME: Finish function_name()" followed by a newline, and should return -1. Each stub must also contain the function's parameters.
Sample output with two calls to get_user_num() and one call to compute_avg():
FIXME: Finish get_user_num()
FIXME: Finish get_user_num()
FIXME: Finish compute_avg()
Avg: -1"
I have tried a bunch of different things, but I just keep getting errors. I'm completely lost on this one. This is what I have so far:
def get_user_num(user_num1, user_num2):
get_user_num = -1
avg = user_num1 + user_num2
return get_user_num
user_num1 = 0
user_num2 = 0
avg_result = 0
user_num1 = get_user_num()
user_num2 = get_user_num()
avg_result = compute_avg(user_num1, user_num2)
print('Avg:', avg_result)
And I am just getting error message after error message. I know I have to use def to define something, but I'm lost.
"FIXME: Finish <function_name>". You don't need to calculate anything in your functions, just make them print what the task says, return-1, and that's itget_user_num? It doesn't (there's nodef get_user_numstatement). Yet it calls this (non-existent!) function inuser_num1 = get_user_num(). What does it mean to call a function that doesn't exist? Nothing, so you get the error