12. For your A


Good Day

Please could someone help me?
My code is as follows:

phrase = "A bird in the hand..."

# Add your for loop
for char in phrase:
  if char == "A" or char == "a":
    print "X"
    print char
#Don't delete this print statement!

It keeps returning the following error. I don’t know what it wants with me.

Did you replace all of the "A"s and "a"s with "X"s? It looks like you printed “X bird in the hXnd…” instead of “X b i r d i n t h e h X n d . . .”.


Would you mind providing a link to the lesson?


Hi Goku :slight_smile:

Thank you, I solved it.
My output was printing it out letter by letter and wanted it as a line.
It was solved by adding “,” at the end of my print statement.

Kind Regards


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.