This is an archived version of the course. Please find the latest version of the course on the main webpage.

Chapter 4: Applying your knowledge

The biggest number

face Josiah Wang

Now let us make the problem slightly harder.

Write a Python program that reads in three integers from the console, and prints out the largest out of the three integers.

Like the previous challenge, do not use min() or max() to solve this.

Remember to test your solution to make sure it behaves correctly for all possible cases you can think of!

Sample run #1

Please enter the first integer: 2
Please enter the second integer: 12
Please enter the third integer: 7
12

Sample run #2

Please enter the first integer: 356
Please enter the second integer: 123
Please enter the third integer: 456
456

Sample run #3

Please enter the first integer: 99999
Please enter the second integer: 99999
Please enter the third integer: 99998
99999

Sample run #4

Please enter the first integer: -1
Please enter the second integer: -5
Please enter the third integer: 0
0

Sample run #5

Please enter the first integer: 1
Please enter the second integer: 1
Please enter the third integer: 1
1