Hi everyone I am having a little problem with a program that I wrote
def P(): a = "a" aa = "aa" b = "b" bb = "bb" text = raw_input("Enter Text: ") SpacedText = ' '.join(list(text)) OutputText = SpacedText if a in OutputText: print aa if b in OutputText: print bb
Now this program works fine but for two things.
1. When I run the program and I am asked to "Enter Text" and I type in "a" the output text is “aa” (same for when I type b). However, when I type in both letter together like this (ba) the output is (aa bb) but what I am looking for is that the output would be in the order I type the letters when I am asked to “Enter Text”.
2. The second problem is that the output is printed diagonally instead of horizontally which is what I would like.
I am sure this errors can be fixed and I would appreciated if anyone could help me with it. Thanks in advance.