samedi 28 février 2015

Quiz Program using a Text File

Am trying to create a quiz program in Python where the questions are stored in one txt file with the answers in another. The questions are set out in the text file as follows:


Which one of these is a percussion instrument? A. Trumpet B. Euphonium C. Viola D. Glockenspiel


The program pulls the questions out in random order and keeps score of the number of right answers. I know how to open files, read from them and display the contents of the file on the screen, I even know now how to randomise the info in the file. However, as there are multiple lines involved AND another file to get the answer from, I have no idea where to start. I would really appreciate any help you could offer me. Feel free to ask questions if you need to clarify anything.





Aucun commentaire:

Enregistrer un commentaire