Largest in list

Question

Write a program to find the largest element from the following list:

lis=[11,30,11,99,99]

in progress 0
YashikaKhurana 55 years 2 Answers 774 views Master 0

Answers ( 2 )

  1. Here’s the code:

    max= -1000
    for i in range(len(lis)):
    if(lis[i]>max):
    max=lis[i]
    else:
    pass
    print(max)

  2. lis=[11,30,11,99,99]

    max(lis)

Leave an answer

Browse
Browse