Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. from random import randint
  2. A=[randint (0,100) for i in range (10)]
  3. print (A)
  4. M = A[0]
  5. count1=0
  6. for i in range(1,10):
  7. if A[i] > M:
  8. M = A[i]
  9. count1=i
  10. print ("A[", count1 , "]=", M, sep="" )
  11. M = A[0]
  12. count2=0
  13. for i in range(1,10):
  14. if A[i] < M:
  15. M = A[i]
  16. count2=i
  17. print ("A[", count2 , "]=", M, sep="" )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement