12. For your A


#1



https://www.codecademy.com/courses/python-beginner-en-cxMGf/1/4?curriculum_id=4f89dab3d788890003000096#


Oops, try again. 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 . . .".

I´m printing as they say, dont know what im doing wrong, hope someone can spot something i dont. Im already printing what the instructions says. "X b i r d i n t h e h X n d . . .None"

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

# Add your for loop





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


#2

Hello :slight_smile:

The empty print statement was supposed to be at the end of the script.

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

# Add your for loop
for char in phrase:
    if char == "A" or char == "a":
         print "X",
    else:
        print char,

#Don't delete this print statement!
print

#3

LoL thanks a lot ! : D


#4

You're very welcome :slight_smile:


#5

Curious, how does the trailing comma feature work in 3.6? I cannot get it to work in 3.6


#6

In Python 2.x trailing comma prevents a new line to be emitted.

To achieve this in Python 3.x you have to use end parameter, example:

print("Hello World!", end="")

#7

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