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 184 views
1 answer 161 views
1 answer 202 views
2 answers 164 views
1 answer 190 views
1 answer 165 views
...