Answer to Question #138516 in Python for Seabass

Question #138516
Write a program that takes three numbers as input from the user, and prints the largest.

Sample Run
Enter a number: 20
Enter a number: 50
Enter a number: 5

Largest: 50
Hint: Remember that the numbers should be compared numerically. Any input from the user must be transformed into an integer, but printed as a string.
1
Expert's answer
2020-10-16T13:12:28-0400
numbers = [] #empty list to store numbers
for _ in range(3):
    num = int(input("Enter a number:")) #user input
    numbers.append(num) #append list with current number
print("Largest: ", max(numbers))  #print the largest number

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
New on Blog
APPROVED BY CLIENTS