prefixes = "JKLMNOPQ" suffix = "ack" for letter in prefixes: if prefixes == "O": print "Ou" + suffix elif prefixes == "Q": print "Qu" + suffix else: print letter + suffix I'm trying to get this print out, but I can't get it....can someone help? Jack Kack Lack Mack Nack Ouack Pack Quack
just go to the print box on the to right of the screen and click it.
I'm not sure I understand....what do I need to change?
prefix = 'jklmn' suffix = 'ack' for pre in range(len(prefix)): print(prefix[pre]+suffix)
@danmei in your code : if prefixes == "O": do smthing you have to write: if letter == "O": do smthing same for your other if statements. cause as you have it right now , the if and elif conditions are always false, since prefixes is "JKLMNOPQ" and not just one letter. And since if and elif are false, it jumps to the else statement and prints every letter of prefixes +suffix. hope it helps
Thanks MicroBot, that helped.
im happy it did!:)
Join our real-time social learning platform and learn together with your friends!