CBSE 11TH CLASS CS PROGRAM 12

 

12. Find the largest/smallest number in a list/tuple

Python

numbers = [10, 5, 20, 3, 8]  # Example list

 

largest = max(numbers)

smallest = min(numbers)

 

print("Largest number:", largest)

print("Smallest number:", smallest)

No comments:

Post a Comment