I am trying to create a list from user input.
When the user enters something like "a,b,c,d,e,f"
and if I turn that into a list directly, the list will look like ['a', ',', 'b', ',', 'c', ',', 'd', ',', 'e', ',', 'f']
. However, naturally, I want it to be just [a,b,c,d,e,f]
. How do I achieve that? I am a newbie, so can you please tell me the simplest way without importing? Thanks in advance.
I looked up lots of posts from here but didn’t find anything similar. I tried taking a list input by something like list_a = list(input("Enter: ")) but it resulted in the problem I mentioned already.
You need to sign in to view this answers
Leave feedback about this