Write a Python program to get the largest number from a list

def func(lst):
    largest = 0
    for item in lst:
        if item >= largest:
            largest = item
    return largest


print(func([1, 2, 5, 6, 8, 10]))


Follow on:
Sunil Shaw

Sunil Shaw

About Author

I am a Web Developer, Love to write code and explain in brief. I Worked on several projects and completed in no time.

Related Page