Below is the Python program to find the maximum and minimum elements in the list
# smallest and largest numbers in a list
lst=list(eval(input("Enter list elements:")))
min=max=lst[0]
for i in range(len(lst)):
if min>lst[i]:
min=lst[i]
if max<lst[i]:
max=lst[i]
print("Minimum value in the list is ",min)
print("Maximum value in the list is ",max)
Output:
Enter list elements:1,-6,5,7,4,3,-9,7
Minimum value in the list is -9
Maximum value in the list is 7