Suppose I get input as apple, how can I split it in list of each character like ['a','p','p','l','e']?
I tried [i for i in input().split('')],
but it outputs error: ValueError: empty separator.
Suppose I get input as apple, how can I split it in list of each character like ['a','p','p','l','e']?
I tried [i for i in input().split('')],
but it outputs error: ValueError: empty separator.
Try list('apple').
This will split the string 'apple' into individual characters and place them inside a list.
Output:
['a','p','p','l','e']
