12/19 help


#1

my code:

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

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

print char

and this is my 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 . . .".

it seems that there is one too many '.' - 4 - where there should be 3.


#2

Hello @systemrockstar31589

You should use the Preformatted text </> it will make it much easier for people to look at your code.

Your problem is that you wrote print char 2 times, if you remove char from your bottom print your code will be fine.

Your code would look like this:

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

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


print

For your A: 12/19