Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. 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]
  2.  
  3.  
  4. def search_min(a):
  5. el_min = a[0]
  6. for elm in a[1:]:
  7. if elm < el_min:
  8. el_min = elm
  9. print("The minimum value in the list is: " + str(el_min))
  10.  
  11.  
  12. def search_max(a):
  13. el_max = a[0]
  14. for elm in a[1:]:
  15. if elm > el_max:
  16. el_max = elm
  17. print("The maximum value in the list is: " + str(el_max))
  18.  
  19. search_min(a)
  20. search_max(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement