FAQ
Sorry, I'm new in here


So, if you want to see the complete code I've fixed it:
http://www.smipple.net/snippet/a7xrturo/Hangman%21%20%3A%29


And here is the part of code that doesn't work:




#The error is marked in the whitespace between letter and in


def displayBoard(HANGMANPICS, missedLetters, correctLetters, secretWord):
     print (HANGMANPICS[len(missedLetters)])
     print()


     print('Missed letters: ', end='')


#Starts problem


      for letter in missedLetters:


#Finishes problem


         print(letter, end=' ')
     print()


     blanks = '_' * len(secretWord)


     for i in range(len(secretWord)):
           if secretWord[i] in correctLetters:
               blanks = blanks[:i] + secretWord[i] + blanks[i+1:]


     for letter in blanks:
         print(letter, end=' ')
     print()






When I press F5 (Run) I get a window that says: 'Invalid Syntax' and the whitespace between letter and in is in color red

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 of 17 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedJun 19, '13 at 9:14p
activeJun 21, '13 at 2:36p
posts17
users9
websitepython.org

People

Translate

site design / logo © 2022 Grokbase