An error in Loops p. 12 : "For your A"


#1



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


After submitting it returns an error but the result seems to be right at the same time...


The right result

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,

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


#2

Here:

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

# Add your for loop
for char in phrase:
    if char == "A" or char == "a":
        print "X",
    else:
        #This is where your `print char,` statement should have gone.


#Don't delete this print statement!
        print char, #This line should not have been edited at all.

#3

Thank you but I have absolutely the same code and it does not work though


#4

Umm did you even read my comments?


#5

Sure but it does not help


#6

Please paste an updated version of your code.


#7

Sorry I have understood the problem. It was because of that last 'print' statement only..
The problem is solved. Thank you!


#8

Very fine. I'm glad you solved it.


#9

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