How to take an number input from user and split it's digits and use each digit separately

*For example*
If user enters '''4568'''
The code should split 4568 into 4,5,6,8
['https://Stackoverflow.com/questions/70277178', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/17627014/']
Use a list comprehension over the user input.

```py
values = [int(i) for i in input()]

```

Note that this code doesn't handles cases where user puts non-digits characters in his input. To deal with this case, you would prefer to write :

```py
values = [int(i) for i in input() if i.isdigit()]

```
Convert it to string, iterate to string and get each character as an integer.

```
# Input from the user
inp = input()
digits=[]
for c in str(inp):
   try:
       digit=int(c)
       # Populate the list with the last digit obtained
       digits.append(digit)
   except:
        # I'm assuming you don't need to worry about any other non integer character
        pass

```

Or in one line, **BUT pay attention that if any non integer character is present into the input, the map fails**:

```
inp = 1234
digits = list(map(int, list(str(inp)))

```

Where `list(str(inp))` splits the string-converted input in the list of its characters, `map` applies the transformation to integer to each element of the latter list, eventually the conversion to list return your desired array

EDIT: I was writing the code while the comment were being written. I've now integrated the direct `int` suggestion to map function

EDIT2: a nitpicky edit to allow for an actual user input instead of a test variable. This does not change the substance at all.