Answer to Question #228701 in Python for srikanth

Question #228701
Largest Number in the List

You are given space-separated integers as input. Write a program to print the maximum number among the given numbers.

Input

The first line of input contains space-separated integers.

Explanation

In the example, the integers given are 

1, 0, 3, 2, 9, 8. The maximum number present among them is 9. So, the output should be 9.

Sample Input 1
1 0 3 2 9 8
Sample Output 1
9
Sample Input 2
-1 -3 -4 0
Sample Output 2
0

1
Expert's answer
2021-08-24T16:42:13-0400
numbers = [int(i) for i in input().split()]
max = numbers[0]
for i in numbers[1:]:
    if max < i:
        max = i
print(max)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS