fork download
  1. def maximum(lista):
  2. max = float('-inf')
  3. for item in lista:
  4. try:
  5. valor = int(item)
  6. if valor > max:
  7. max = valor
  8. except:
  9. pass
  10. return max
  11.  
  12. print(maximum(['4', '07', '08', '2017', '364', '355673087875675']))
  13. print(maximum(['4', '07', '08', '355673087875675', 'a', '2017']))
  14.  
  15. #https://pt.stackoverflow.com/q/257905/101
Success #stdin #stdout 0.03s 9288KB
stdin
Standard input is empty
stdout
355673087875675
355673087875675