I need input to be put into separate words in a list.
What I have right now:
lines = []last_line = []while True: cmd = input("-") if cmd == "del": print("~deleted") last_line.clear() elif cmd == "line": lines.append(last_line) last_line.clear() last_line.append(input("~line: ")) elif cmd == "show": split = [word for word in lines[0].split(" ")] else: print("~invalid command")What I want it to do, is when I type "show" it shows what has been inputted, but in separate parts of the list.I realise that this is not very clear, so what I mean is that at 'split = [word for word in lines[0].split(" ")]' isn't working, and I don't know what to put there.