Python program to find the smallest and largest number in list of items

Опубликовано: 12 Октябрь 2024
на канале: programmer aditya
2,134
44

from this video you will able to write a program for finding the smallest and the largest number from the list of items.

the code of this program is shown below:

#Python program for largest and smallest item from all items in a list
#For largest
list1=[5,4,2,1,9,8]
list1.sort()
print(list1)
a=list1[-1]
print("the largest item in the list:",a)

#for smallest
list1=[5,4,2,1,9,8]
list1.sort()
print(list1)
a=list1[0]
print("the smallest item in the list:",a)
In this video, we will show you how to write a Python program to find the smallest and largest number in a list of items. We will walk you through the process of coding a function that takes a list of numbers as input and returns the smallest and largest number in the list. We will explain the logic behind the program and provide examples of how to use the function. Whether you're a beginner looking to learn Python or a seasoned programmer looking for a quick refresher, this video will help you understand the basics of programming with Python. So, sit back, relax, and let's explore the world of Python programming together!

#pythonprogramming #smallestlargest #pythonfunctions #beginnerpython #pythonforbeginners #codingtutorial #learnpython #pythonbasics #programmingsyntax #pythonlogic #pythoncode #computerscience #codingeducation #codingtips #tutorialvideos #pythonlearning #pythontutorial #programmingforbeginners #datatypes #pythonmathematics