How to convert a string list into an integer in python [duplicate]

Use split() to split at the commas, use int() to convert to integer:

user_lst = map(int, user.split(","))

Leave a Comment