Write Program to Find Biggest and Smallest of n Numbers in Python || List || Python
In this we are going to see a basic program to Find Biggest and Smallest of n Numbers in Python Programming Language.

list1 = [2, 4, 7, 10, 9, 1, 31, 40, 15, 67]
# First Method
print("List 1 : ", list1)
list1.sort()
# Indexing Starts From 0 Which Gives Us The First Element
smallest = list1[0]
# Negative Index Gives The Last Element
largest = list1[-1]
print("The Smallest Number In The List Is : ", smallest)
print("The Largest Number In The List Is : ", largest)
print("---------------------------------------------------------------")
# Second Method
list2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
print("List 2 : ", list2)
print("The Maximum Value Of The List Is : ", max(list2))
print("The Minimum Value Of The List Is : ", min(list2))

# Coded By DHIRAJ SHELKE

#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post