How to find the max value in a list of int strings with Python

1 Answer

0 votes
lst = ['4', '227', '98', '99', '221'] 
   
mx = max(int(n) for n in lst) 
   
print(mx) 
 
 
  
'''
run:
 
227
  
'''

 



answered Dec 17, 2020 by avibootz

Related questions

1 answer 283 views
1 answer 293 views
1 answer 303 views
2 answers 296 views
1 answer 296 views
4 answers 533 views
...