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 194 views
1 answer 166 views
1 answer 209 views
2 answers 175 views
1 answer 200 views
1 answer 173 views
...