For your A: What is my wrong?


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

for i in phrase:
if i == " ":
if i == "A" or i == "a":
print "X" + " "
print i + " "



you need to use , to print everything at the same line, see the instructions


I corrected the code to this one:

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

for char in phrase:
    if char == " ":
    if char == "A" or char == "a":
        print "X" + " ",
        print char + " ",

#Don't delete this print statement!

But I got an error:
Oops, try again. Did you replace all of the "A"s and "a"s with "X"s? It looks like you printed "X b i r d i n t h e h X n d . . ." instead of "X b i r d i n t h e h X n d . . .".


please do what the instructions tell, i don't see any mention of if char == " ": continue or printing spaces when printing X or char


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