In: Computer Science
Program:
print("\nKeep entering positive numbers.")
print("to quit, input a negative number\n")
#list to store all the numbers
nums=[]
#infinite loop
while(True):
no=int(input("enter a number: "))
if(no<0):
break
#storing the entered number in the list using
append
nums.append(no)
#max() - to get largest number
print("\nLargest number entered: ",max(nums))
print("\n")
Program Screenshot:
Output: