I am making a command in python that takes a message and turns it into a list, which then removes the first 5 letters (!calc). Afterwards it checks each item in the list if it is a letter or a space. If it is, then it deletes it from the list.
In other words, if it gets the message "!calc abcdef" I want it to print "[]" (nothing).
Instead I get "['a', 'c', 'e']
message = "!calc abcdef"
if message.startswith("!calc"): #checks if the message starts with !calc
msg = list(message)
del msg[0:5] #deletes the !calc part
for i in msg: #goes through each item [" ", "a", "b", "c", "d", "e", "f"]
if (i.isalpha()) == True: #checks if the item is a letter
msg.remove(i) #removes the letter
elif (i.isspace()) == True: #checks if the item is a space
msg.remove(i) #removes the space
print(msg)