[Solved] Why is there a blank line between my print and raw_input lines?


EDIT The conclusion from the discussion in the comments is it’s a bug in Canopy IDE.

The code you’re showing us is not the code you’re running.

Your output is this:

Available Letters: abcdefghijklmnopqrstuwxyz.

Which is supposed to be printed by this (note the dot added on the end):

print "Available Letters: "  + getAvailableLetters(lettersGuessed) + "."

But getAvailableLetters also adds a dot on the end of its return value.

def getAvailableLetters(lettersGuessed):
    import string
    str = string.ascii_lowercase
    for char in lettersGuessed:
        if char in str:
            str = str.replace(char, "") 
    return str + '.'

So the output should be this:

Available Letters: abcdefghijklmnopqrstuwxyz..

My conclusion is the code you’re showing us and the code you’re running cannot be the same. I would suggest pasting the code somewhere for us to examine fully. Github Gist will do.

8

solved Why is there a blank line between my print and raw_input lines?