Problem with automatic corrector in (for a) practice


#1



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 "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 . . .".


the code run fine, and print correcly .
print this:
x b i r d i n t h e h x n d . . .
None


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

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





#Don't delete this print statement!
print


#2

x and X are different characters


#3

why i print x b i r d i n t h e h x n d . . . with spaces in the post but when published the post
dont have spaces?


#4

Perhaps the browser removes them, same as if you have duplicate spaces in text in these posts
If you open a file with the below content this in a browser, only one space shows.

hello                        world

while for this it would show them all:

<pre>hello                        world</pre>

#5

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