12. For your a - why the extra spaces?


#1



Loops: 12. for your a


first, this works fine, it's accepted.

I have a question about the output.
Why is there extra spacing between each letter in the output?

it gives:
X b i r d i n t h e h X n d . . .

but I would think it should give:
X bird in the hXnd...

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


#2

The comma adds a space and holds the draw pencil at that place.


#3

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