#๐Ÿ”’ Function stubs: Statistics. help pls

11 messages ยท Page 1 of 1 (latest)

void vigil
#
def get_user_num():
    print(f'FIXME: Finish {get_user_num()}')
    print(f'FIXME: Finish {get_user_num()}')
    return print(f'Avg: -1')




def compute_avg():
    print(f'FIXME: Finish {compute_avg()}')
    return print(f'Avg: -1')

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(f'Avg: {avg_result}')```
runic fjordBOT
#

@void vigil

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

still silo
#

What is the problem?

still silo
void vigil
# still silo What is the function supposed to print and what is it supposed to return?

def get_user_num():
    print('FIXME: Finish get_user_num()')
    print('FIXME: Finish get_user_num()')
    return -1

def compute_avg(user_num1, user_num):
    print('FIXME: Finish compute_avg()')
    return -1

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(f'Avg: {avg_result}')```
#

!e ```py

def get_user_num():
print('FIXME: Finish get_user_num()')
print('FIXME: Finish get_user_num()')
return -1

def compute_avg(user_num1, user_num):
print('FIXME: Finish compute_avg()')
return -1

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(f'Avg: {avg_result}')```

runic fjordBOT
#

@void vigil :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | FIXME: Finish get_user_num()
002 | FIXME: Finish get_user_num()
003 | FIXME: Finish get_user_num()
004 | FIXME: Finish get_user_num()
005 | FIXME: Finish compute_avg()
006 | Avg: -1
void vigil
#

It's supposed to print py FIXME: Finish get_user_num() FIXME: Finish get_user_num() FIXME: Finish compute_avg() Avg: -1

still silo
runic fjordBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.