For your A


#1



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

I don't understand how

print char,

will cause the code to print horizontally and there are no commas?


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,


#2

The , character after the print statement means that the next print statement will keep printing on the same line. I you remove the empty print statement None will be on the same line as X bird in the hxnd... thus resulting in an error.


#3

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