I have a list say:
['batting average', '306', 'ERA', '1710']
How can I convert the intended numbers without touching the strings?
Thank you for the help.
changed_list = [int(f) if f.isdigit() else f for f in original_list]
1.4m articles
1.4m replys
5 comments
57.0k users