I. RAJESH KUMAR (MSc, M.Tech, B.Ed, M.Th)
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