Find and display the largest number of a list without using built-in function max(). Your program should ask the user to input values in list from keyboard.

Source Code

mylist = []
size = int(input('How many elements you want to enter? '))

print('Enter',str(size),'positive numbers')

for i in range(size):
    data = int(input())
    mylist.append(data)

max = 0
for data in mylist:
    if data > max:
        max = data

print('The largest number in list is', max)

Output

How many elements you want to enter? 5
Enter 5 positive numbers
34
2
45
19
23
The largest number in list is 45