Write a simple python program to find the maximum of any number of numbers as defined by the user.
# The required output is as:
Please input numbers to find their maximum and press - 1 to terminate calculation
Please input next number
Please input next number
Please input next number
Please input next number
Please input next number
maximum is: 10
Answers
Answered by
0
Explanation:
n = int(input())
li = [int(x) for x in input().split()][:n]
print(max(li))
Answered by
1
maximum of any number of numbers as defined by the user
Explanation:
python program to find the maximum of any number of numbers as defined by the user.
maxi = int(input("Enter a number: "))
while(True):
temp = int(input("Please input next number: "))
if temp == -1: break
maxi = max(maxi, temp)
print("Maximum is: {}".format(maxi))
hence, this is the python program to find the maximum of any number of numbers as defined by the user.
Similar questions