195k views
4 votes
PLZ HELP NEEDS TO BE ANSWERED ASAP THANK YOU

Please describe what this assignment is about

Write a program to input 6 numbers. After each number is input, print the biggest of the numbers entered so far.

Sample Run
Enter a number: 1

Largest: 1

Enter a number: 3

Largest: 3

Enter a number: 4

Largest: 4

Enter a number: 9

Largest: 9

Enter a number: 3

Largest: 9

Enter a number: 5

Largest: 9

User Haha TTpro
by
4.6k points

2 Answers

2 votes

Answer:

largest = None

for i in range(0,6):

d = int(input("Enter a number: "))

if not largest or d > largest:

largest = d

print("Largest: " + str(largest))

Step-by-step explanation:

Worked for me!!! :)

User Araneae
by
4.6k points
2 votes

In python:

lst = ([])

largest = 0

while len(lst) != 6:

user_number = int(input("Enter a number: "))

lst.append(user_number)

for i in lst:

if i > largest:

largest = i

print(largest)

I hope this helps

User Daniel Hanrahan
by
4.3k points