fork download
  1. # your code goes here
  2.  
  3. sampledata=[35, 48, 3, 4, 50, 43, 7, 19, 9, 23,15, 13, 11, 27, 22, 10, 40, 32, 44, 31, 42, 6,37, 12, 18, 25, 16, 8, 20, 24, 17, 38, 29, 46, 21, 30, 33, 1, 36, 14, 26, 39, 31, 31, 45, 28, 47, 2, 49, 5]
  4. M=sampledata[0]
  5. for i in range(1,50):
  6. if M<sampledata[i] :
  7. M= sampledata[i]
  8. 위치=i
  9. print('최댓값=',int(M))
  10. print('인덱스=',int(위치))
  11.  
  12. sum=0
  13. for i in range(0,50):
  14. if sampledata[i]%2==0:
  15. sum=sum+1
  16. print('짝수의개수=',int(sum))
  17.  
Success #stdin #stdout 0.03s 9624KB
stdin
Standard input is empty
stdout
최댓값= 50
인덱스= 4
짝수의개수= 24