livepython.net

87. Python Program to Find the Largest of N Numbers

MediumSum and count

Overview

Keep the best value so far, and replace it when a bigger one arrives.

Problem Statement

The first line says how many numbers follow (1 or more). Read that many whole numbers, one per line, and print the largest. The numbers can be negative. For example, for 4 followed by 12, 40, 7 and 33:

Largest: 40

Use input() with no prompt text: the tests type the input for you, and a prompt would end up in your output.

Input

One value per line, in this order. Example:

4
12
40
7
33

Output

The output for that example:

Largest: 40

The tests try 3 different inputs.

Learn this firstChapter 10 · Sum and Count with a Python for Loop
solution.py
# write your code here

EXPECTED OUTPUT

1Largest: 40

YOUR OUTPUT

Press Run to see your output here. Lines are compared with the expected output.