KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
What is the quickest and cleanest way to convert an integer into a list ? For example, change 132 into [1,3,2] and 23 into [2,3] . I have a variable which is an int , and I want to be able to compare the individual digits so I thought making it into a list would be best, since I can just do int(number[0]) , int(number[1]) to easily convert the list element back into int for digit operations.
Tags (comma-separated)
Save Edits
Cancel