How to receive multiple Python beginners and process them

Asked 2 years ago, Updated 2 years ago, 18 views

As shown in the picture, use the parameter as a variable factor in the function.

When you receive input.split so that you can receive multiple inputs. If you print it out, it comes out divided.

I don't know how to solve the problem next

python

2022-09-20 18:57

1 Answers

def avg(num):
    print(sum(num)/len(num))
def max(num):
    print(max(num))
def min(num):
    print(min(num))

input_num = input() # 3 45 38
nums = input_num.split(' ')
num = [int(n) for n in nums]

avg(num)
max(num)
min(num)


2022-09-20 18:57

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.