Do you want to separate several numbers? 1 2 3 -> [1, 2, 3]

n = str(input())
n = n.split()
numbers = [int(i) for i in n]
print(numbers)

Or split a number in numeral? 123 -> [1, 2, 3]

n = str(input())
numbers = [int(i) for i in n]
print(numbers)

Use Nikhil answer, if you want to split a number with delimiters 1%3 -> [1, 3]

Answer from Sergej Schelle on Stack Overflow
Discussions

How to split int into digits?
x = 19 digits = str(x) And maybe that's enough, because a string is a sequence which can be indexed, sliced, looped. But if you need it to be a list then you could do digits = list(str(x)) instead. Or maybe you want integers for the items in the list? Then it'd have to be like digits = [int(digit) for digit in str(x)] More on reddit.com
🌐 r/learnpython
5
4
January 22, 2023
can i split a string of user input, into individual intergers?
It's very common to use the string split() method . Run this code to see what it does: integers = input("Enter integers separated by spaces: ") integers = integers.split() print(integers) As you can see, the result is a list of strings containing each number. Now the task is to convert those strings into integers. There are at least three ways to do that: use a for loop to get each string, convert to an integer and then append the integer to a new list do the same as the loop above but use a list comprehension use the map() function Try the for loop first. More on reddit.com
🌐 r/learnpython
7
1
November 11, 2023
python - How to split an integer? - Stack Overflow
I'm not really sure how to go about this but I'm trying to make a guessing game and give feedback on the user's input. For example if the number to be guessed is 6709 and the user inputs 6908 the i... More on stackoverflow.com
🌐 stackoverflow.com
python 3.x - How Can I Separate Two Input Integers? - Stack Overflow
I'm not very old in programming, I wanna input a number (n) and depending on it, I wanna input n integers separated with one space using while loop(e.g) I tried: ... I'm using a counter and every time I decrement it, I'm allowed to input new integer until the counter reaches zero ... Save this answer. ... Show activity on this post. ... accept an arbitrary input, split ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Delft Stack
delftstack.com › "delft stack" › "howto" › "python tutorial: how-to guides for everyday python problems" › "how to split an integer into digits in python"
How to Split an Integer Into Digits in Python | Delft Stack
February 14, 2024 - For a negative integer, treat the ... through a string is unsuitable, or use map() and str.split() when the input is already a whitespace-separated string of digit tokens....
🌐
Quora
quora.com › How-to-split-two-integers-in-the-same-line-in-python-using-input-method
How to split two integers in the same line in python, using input() method? - Quora
Answer (1 of 9): For two integers you can use : [code]a , b = map(int , input().split()) [/code]If the input contains two different data types ( say an integer and a character) , you can use : [code]a , b = input().split() #Assuming a is an integer a = int(a) [/code]P.S : The above mentione...
🌐
Bobby Hadz
bobbyhadz.com › blog › python-split-integer-into-digits
How to Split an Integer into Digits in Python | bobbyhadz
April 8, 2024 - We iterate over the digits that ... before appending the result to a list. Alternatively, you can use the map() function to split an integer into digits....
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-split-a-list-having-single-integer
Split a List having Single Integer - Python - GeeksforGeeks
July 11, 2025 - # Initializing list a = [12345] # Extracting digits using integer division num = a[0] result = [] while num > 0: result.append(num % 10) # Extract last digit num //= 10 # Remove last digit result.reverse() # Reverse to maintain correct order ...
Find elsewhere
🌐
Reddit
reddit.com › r/learnpython › can i split a string of user input, into individual intergers?
r/learnpython on Reddit: can i split a string of user input, into individual intergers?
November 11, 2023 - It's very common to use the string split() method. Run this code to see what it does: integers = input("Enter integers separated by spaces: ") integers = integers.split() print(integers)
🌐
Its Linux FOSS
itslinuxfoss.com › home › python › how to split an integer into digits in python?
How to Split an Integer Into Digits in Python? – Its Linux FOSS
January 3, 2023 - The content supported by this guide is provided below: Method 1: Use str() and int() Functions in List Comprehension ... Let’s start with the first method. Python’s inbuilt “str()” function typecast the input value into a string and ...
🌐
YouTube
youtube.com › codesavant
Split an Integer Into a List of Digits in Python - YouTube
This tutorial shows you how to use the modulo operator and floor division to split an integer into a list of digits in Python 3. In this video, you learn to ...
Published: December 11, 2021
Views: 11K
🌐
ARCsoft
arcsoft.uvic.ca › log › 2025-04-09-splitting-an-integer-in-python
Splitting a numeric code in Python • ARCsoft
April 9, 2025 - Perhaps the more obvious solution is to split it as a string as the first two digits and then the last two digits. Of course, the integer needs to be converted into a string first. Then we convert the parts back into integers.
🌐
DEV Community
dev.to › jabermudez11 › splitting-a-number-into-individual-digits-python-3g8a
Splitting a Number into Individual Digits Python - DEV Community
December 6, 2020 - If you are looking only for the code then here it is number = 12345 numList = [int(digit) for digi... Tagged with python, beginners.
🌐
GeeksforGeeks
geeksforgeeks.org › python › taking-multiple-inputs-from-user-in-python
Taking multiple inputs from user in Python - GeeksforGeeks
June 26, 2026 - The user first specifies how many inputs will be entered. ... By default, split() separates values using whitespace. It also accepts a separator argument, allowing users to enter values separated by commas, hyphens, or other delimiters.
🌐
Python Guides
pythonguides.com › split-a-number-into-digits-in-python
How to Split a Number into Digits in Python?
March 19, 2025 - In this approach, we define a function called split_number() that takes a number as input.
🌐
Stack Overflow
stackoverflow.com › questions › 65134247 › how-can-i-separate-two-input-integers
python 3.x - How Can I Separate Two Input Integers? - Stack Overflow
More "pythonic" than chaining list and map would be a list comprehension: user_input = input() a = [int(s) for s in user_input.split()] Then take the n first elements of this list as suggested by @Moosefeather in the comments. You should wrap the whole thing in a try/except block to catch ValueErrors if anything in the input is not an integer, or IndexErrors if the given input is not long enough.