"For your A"


#1

Hi , this exercise won’t let me move further. Keeps telling me "Did you replace all of the "A"s and "a"s with "X"s? It looks like you printed “” instead of “X b i r d i n t h e h X n d . . .”. " but I’m pretty sure I wrote the scripts as specified by the instructions. Anyone with some solution or workaround please?? Thanks.
This is the link to my code: https://www.codecademy.com/en/courses/learn-python/lessons/loops/exercises/for-your-a

This is my code:

’ ’ '
phrase = “A bird in the hand…”

Add your for loop

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

#Don’t delete this print statement!
print char,

’ ’ ’

The specifications indicates that a trailing comma (,) needs to follow after the element I want it to print.

Any suggestions, would be greatly appreciated. Thanks


#2

Don’t use last print statement for your own code.

it’s just for checking.

#Don't delete this print statement!
print

ignore it and write your own code.


#3

Thanks! . Appreciate you took your time to check my code. I’ll try that out.


#4

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