Â
In this we are going to see how to build a function to to find the Largest and Smallest Numbers in a List - Type 1 of Functions in Python Programming Language.
def min_max():
list = [4, 7, 1, 11, 21, 9, 3, 5, 2, 10]
min = list[0]
max = list[0]
for i in list:
if i < min:
min = i
if i > max:
max = i
print("Smallest : ", min, "Largest : ", max)
min_max()
# Coded By DHIRAJ SHELKE
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP