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

def func(lst):
    largest = lst[0]
    for item in lst:
        if item <= largest:
            largest = item
    return largest


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


Follow on:
  • Twitter
  • Facebook
  • Instagram
  • Linkedin
  • Linkedin
Sunil Shaw

Sunil Shaw

  • Youtube
  • Instagram
  • Twitter
  • Facebook
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