There's nothing that will automatically treat an int as if it's a list of one int. You need to check whether the value is a list or not:

(a if type(a) is list else [a]) + (b if type(b) is list else [b]) + (c if type(c) is list else [c])

If you have to do this often you might want to write a function:

def as_list(x):
    if type(x) is list:
        return x
    else:
        return [x]

Then you can write:

as_list(a) + as_list(b) + as_list(c)
Answer from Barmar on Stack Overflow
Top answer
1 of 12
106

Convert the integer to string first, and then use map to apply int on it:

>>> num = 132
>>> map(int, str(num))    #note, This will return a map object in python 3.
[1, 3, 2]

or using a list comprehension:

>>> [int(x) for x in str(num)]
[1, 3, 2]
2 of 12
24

There are already great methods already mentioned on this page, however it does seem a little obscure as to which to use. So I have added some mesurements so you can more easily decide for yourself:


A large number has been used (for overhead) 1111111111111122222222222222222333333333333333333333

Using map(int, str(num)):

import timeit

def method():
    num = 1111111111111122222222222222222333333333333333333333
    return map(int, str(num))

print(timeit.timeit("method()", setup="from __main__ import method", number=10000)

Output: 0.018631496999999997

Using list comprehension:

import timeit

def method():
    num = 1111111111111122222222222222222333333333333333333333
    return [int(x) for x in str(num)]

print(timeit.timeit("method()", setup="from __main__ import method", number=10000))

Output: 0.28403817900000006

Code taken from this answer

The results show that the first method involving inbuilt methods is much faster than list comprehension.

The "mathematical way":

import timeit

def method():
    q = 1111111111111122222222222222222333333333333333333333
    ret = []
    while q != 0:
        q, r = divmod(q, 10) # Divide by 10, see the remainder
        ret.insert(0, r) # The remainder is the first to the right digit
    return ret

print(timeit.timeit("method()", setup="from __main__ import method", number=10000))

Output: 0.38133582499999996

Code taken from this answer

The list(str(123)) method (does not provide the right output):

import timeit

def method():
    return list(str(1111111111111122222222222222222333333333333333333333))
    
print(timeit.timeit("method()", setup="from __main__ import method", number=10000))

Output: 0.028560138000000013

Code taken from this answer

The answer by Duberly González Molinari:

import timeit

def method():
    n = 1111111111111122222222222222222333333333333333333333
    l = []
    while n != 0:
        l = [n % 10] + l
        n = n // 10
    return l

print(timeit.timeit("method()", setup="from __main__ import method", number=10000))

Output: 0.37039988200000007

Code taken from this answer

Remarks:

In all cases the map(int, str(num)) is the fastest method (and is therefore probably the best method to use). List comprehension is the second fastest (but the method using map(int, str(num)) is probably the most desirable of the two.

Those that reinvent the wheel are interesting but are probably not so desirable in real use.

Discussions

How to convert an integer to a list in python? - Stack Overflow
I have an integer object for example a = 1234 and I want to convert it to a list, so it would look something like [1234]. I tried converting it into a string first and then converting it to a list ... More on stackoverflow.com
🌐 stackoverflow.com
How to convert a single number into a single item list in python - Stack Overflow
My solution: >>> i = 2 >>> list1 = [] >>> list1.append(i) >>> list1 [2] Is there a more elegant solution? More on stackoverflow.com
🌐 stackoverflow.com
How to convert an input (number+string) to list, without converting the number into a string?
2 started as string, it was never an int. You can convert it to int if you want. with list_num[0] = int(list_num[0]) More on reddit.com
🌐 r/learnpython
7
1
March 6, 2022
unicode to string conversion in nested list?
In your second example, you are appending the returned strings back to your list of lists, instead of to a sub-list that will then be appended to a final list at the end. Here is an example of doing that without any list comprehension. list_of_lists = [["one", "two"], ["three", "four"]] final_list = [] #This is the list that you want to output at the end for list in list_of_lists: string_list = [] #This is a list of the current strings for elem in list: string_list.append(elem.unicode('utf8')) #Current strings are appended to a lit final_list.append(string_list) #Now all those string lists are appended to a list of lists to output I'm sure someone can add a much better way to do it. That format should work though. More on reddit.com
🌐 r/learnpython
4
2
May 31, 2016
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-convert-number-to-list-of-integers
Python - Convert Number to List of Integers - GeeksforGeeks
Combination of str() and map() is a straightforward and efficient way to convert a number into a list of integers.
Published: July 11, 2025
🌐
Finxter
blog.finxter.com › home › learn python blog › how to convert an integer to a list in python
How to Convert an Integer to a List in Python - Be on the Right Side of Change
August 22, 2022 - The results are output to the terminal as a List of Integers. This example uses List and the map() function to convert an Integer to a String, extract each element and convert it to a List of Integers.
🌐
w3resource
w3resource.com › python-exercises › list › python-data-type-list-exercise-234.php
Python: Convert a given number (integer) to a list of digits - w3resource
June 28, 2025 - # Define a function 'digitize' that takes an integer 'n' as input. def digitize(n): # Convert the integer 'n' to a string, map each character to an integer, and create a list of those integers. return list(map(int, str(n))) # Call the 'digitize' ...
Find elsewhere
🌐
Quora
quora.com › How-do-I-convert-an-7-digit-integer-to-a-list-in-Python
How to convert an 7-digit integer to a list in Python - Quora
Quora is a place to gain and share knowledge. It's a platform to ask questions and connect with people who contribute unique insights and quality answers.
🌐
TutorialsPoint
tutorialspoint.com › convert-number-to-list-of-integers-in-python
Convert number to list of integers in Python
May 20, 2020 - This article explores two efficient approaches: list comprehension and the map() function with str(). List comprehension provides a concise way to convert each digit by first converting the number to a string, then iterating through each character ...
🌐
w3reference
w3reference.com › blog › pythonic-way-to-convert-variable-to-list
The Pythonic Way to Convert a Variable to a List: Handling Single Elements and List Inputs — w3reference.com
Converting variables to lists while handling single elements and existing inputs is a common task in Python. The "Pythonic" approach depends on your use case: Use the basic ternary method for simplicity when only lists and non-iterables need handling. Use the enhanced helper function for granular control over strings, tuples, and other iterables. Avoid the try-except method unless you explicitly want to split strings into characters.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-split-a-list-having-single-integer
Split a List having Single Integer - Python - GeeksforGeeks
July 11, 2025 - We are given a list containing a single integer, and our task is to split it into separate digits while keeping the list structure intact. For example, if the input is a = [12345], the output should be [1, 2, 3, 4, 5]. Let's discuss different methods to do this in Python. We can convert the integer ...
🌐
TutorialsPoint
tutorialspoint.com › article › conversion-of-integer-string-to-list-in-python
Conversion of Integer String to list in Python
March 27, 2026 - import numpy as np int_str = "11 16 17 14 89" result = np.fromstring(int_str, dtype=int, sep=' ').tolist() print("Converted list:", result)
🌐
LabEx
labex.io › tutorials › convert-number-to-digit-list-in-python-13623
Convert Number to Digit List in Python
In this challenge, you have learned how to convert a number into a list of its digits using Python. By using the map() function and the int function, you can easily convert each character in a string to an integer and return a list of those integers.
🌐
YouTube
youtube.com › watch
How to convert a list of ints to a list of strings in Python - YouTube
In this tutorial, I'm gonna be showing you how to convert a list of ints to a list of strings in Python by using map() function.
Published: June 3, 2021
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-integers-string-to-integer-list
Python - Integers String to Integer List - GeeksforGeeks
July 15, 2025 - Using split() and map() will allow us to split a string into individual elements and then apply a function to each element. ... s = "1 2 3 4 5" # Convert the string to a list of integers using split and map int_list = list(map(int, s.split())) ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-program-to-convert-list-of-integer-to-list-of-string
Python - Convert List of Integers to a List of Strings - GeeksforGeeks
July 12, 2025 - For each element x in a, we convert it using str(x) and append it to b. reduce() function from the functools module can also be used, although it’s a bit more complex than the previous methods. It reduces a list into a single value using a function, which can be used to build a list in this case.
🌐
Python Help
pythonhelp.org › tutorials › convert-list-to-int
How to convert a list to int in Python
September 23, 2024 - Before diving into the methods, it’s essential to understand the basic concept of data types in Python. A list is a collection of items, which can be of different data types, while an integer is a whole number without a fractional component. Converting a list to an integer involves transforming the list’s elements into a single numerical value.
🌐
YouTube
youtube.com › dataeng uncomplicated
Convert a String of Numbers Into a List of Int in Python - YouTube
In one line of code, this tutorial explains how to convert a string of numbers into a list of integers in python. When pulling data from various sources, you...
Published: December 5, 2020
Views: 23K