Created
September 22, 2019 06:13
-
-
Save goyalrohit/e802db7640600a34295f747681930b02 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#string with commas | |
millions = '25,000,000' | |
#convert to integer | |
intMillions = int(millions.replace(',','')) | |
print (intMillions) | |
#list of strings | |
list_str = ['2019', '2020', '2021'] | |
#convert to list of integers | |
list_int = [int(a) for a in list_str] | |
print (list_int) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment