Input string has 'n' times of X. Like this "XXXXX"
Need to split the string and make out a list in which each character of the string(X) is each element of list.
Constraints:
0 <= X <= any number
'n' is unknown
Example 1: X is 12,
Input string : "121212121212121212"
Output list : [12,12,12,12,12,12,12,12,12]
Example 2: X is 2,
Input string : "2222"
Output list : [2,2,2,2]
Example 3: X is 489,
Input string : "489489489"
Output list : [489,489,489]
I tried this approach
my_list = list(input_string)
I am getting output like,
[1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2]
Can anyone help me to resolve this?
Edit 1: I am new to stackoverflow. Please help me to edit this question properly.
Edit 2: As this question is clear and understandable, please consider upvoting.