Keeping the data of a variable between runs of code

前端 未结 3 2222
星月不相逢
星月不相逢 2020-12-05 22:16

For a school project I am making a hangman game in Python. Right now my code picks a word from a dictionary like so:

WordList = [\"cat\", \"hat\", \"jump\",          


        
3条回答
  •  清歌不尽
    2020-12-05 22:30

    You have to use persistent storage: write the words in a file when you add them and retrieve them from this file when the program starts.

提交回复
热议问题