Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = [8, -1, -41, -71, -97, -124, -126, -117, -107, -78, -26, 10, 46, 63, 94, 100, 88, 87, 105, 109, 81, 39, 7, -12]
- def search_min(a):
- el_min = a[0]
- for elm in a[1:]:
- if elm < el_min:
- el_min = elm
- print("The minimum value in the list is: " + str(el_min))
- def search_max(a):
- el_max = a[0]
- for elm in a[1:]:
- if elm > el_max:
- el_max = elm
- print("The maximum value in the list is: " + str(el_max))
- search_min(a)
- search_max(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement