Respuesta :
Answer:
txt = input("Enter numbers: ")
numbers = txt.split(" ")
total = 0
max = 0
for i in numbers:
total = total + int(i)
if(int(i)>max):
max = int(i)
print(round(total/len(numbers)))
print(max)
Explanation:
This solution is implemented using Python programming language
This prompts user for input
txt = input("Enter numbers: ")
This splits user input into list
numbers = txt.split(" ")
The next two line initialize total and max to 0, respectively
total = 0
max = 0
This iterates through the list
for i in numbers:
This sum up the items in the list (i.e. user inputs)
total = total + int(i)
This checks for the maximum
if(int(i)>max):
max = int(i)
This calculates and prints the average
print(round(total/len(numbers)))
This prints the max
print(max)
Answer:
txt = input()
numbers = txt.split(" ")
total = 0
max = 0
for i in numbers:
total = total + int(i)
if(int(i)>max):
max = int(i)
print(round(total/len(numbers)), '', end="")
print(max)
Explanation:
I just added to the end so that the Max of 10 20 is on the same line with space