This Python program receives a list of numbers and displays the maximum value without using any loop.
It uses Python’s built-in max() function to achieve the result directly and efficiently.
# Sample list of numbers
numbers = [42, 17, 88, 23, 59]
# Find the maximum value without using a loop
maximum = max(numbers)
# Display the result
print("Maximum value in the list:", maximum)
Maximum value in the list: 88
- The list numbers contains several integer values
- The built-in max() function returns the largest element in the list
- No for or while loop is used
- The result is printed using print()