For your A


#1



error:

Oops, try again. Did you delete the string "phrase"? You can click the red Reset button to start over.

File "python", line 5
if char == 'A' or char == 'a'
____________________ ^
SyntaxError: invalid syntax

I'm a bit lost, why is it saying this?

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

You forgot a colon. Also, your indentation is off.


#3

I got it now, thanks for the help!


#4

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

why is it?

Oops, try again.
Did you replace all of the "A"s and "a"s with "X"s? It looks like
you printed "X bird in the hXnd..." instead of "X b i r d i n t h e
h X n d . . .".


#5

@smallpointer: There are some extra blank spaces between each letter and that's the expected output.

Add a comma (",") right after your print and that will do the work.


#6

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


#7

Oops, try again.
Did you replace all of the "A"s and "a"s with "X"s? It looks like
you printed "X bird in the hX nd..." instead of "X b i r d i n t h
e h X n d . . .".


#8

Still not......:cry:


#9

OK ...thanks so much...


#10

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


#11

yes,.
print in the last will use to put the cursor in next line after printing the result. That is what the assignment is expecting from us.!!!!!!