This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Component 2 of elements Quiz project - making the question to ask the user | |
Will get the amount of elements corresponding to the difficulty | |
And then ask the question with those, and only those elements in it | |
Will also have the answer for the question stored in a separate variable | |
Written by Nathan Smith | |
05/08/2021""" | |
import ast | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Component 3.5 of elements Quiz project - Spell checker | |
This program will check a response against a model response | |
It will let slip ONE of the following: two letters mixed up (e.g. Soduim) | |
A letter out of place (e.g. Sodiun), or an added letter (e.g. Soedium) | |
It will either return "bad" which means the answer should be marked wrong | |
or "fine" which means that the user should be asked to check their spelling | |
Written by Nathan Smith | |
23/08/2021""" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Component 3 of elements Quiz project - Checking the users answer | |
Will check the users response against a model answer | |
Will also run a function that checks the spelling of the answer | |
Written by Nathan Smith | |
23/08/21""" | |
# This is the function from 3.5spell_check.py | |
def check_spell(correct_answer, user_answer): | |
checking_list = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Component 4 of elements Quiz project - End summary | |
This component will tell the user how many questions | |
they have got right and wrong once they quit | |
Written by Nathan Smith | |
24/08/21""" | |
# These variables are just here for the purpose of the test, | |
# they will be given values in the main routine | |
right_answers = 5 | |
wrong_answers = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Elements Quiz project - fully working program combining all 4.5 components | |
First version of fully working program, not tested for usability | |
Written by Nathan Smith | |
25/08/21""" | |
import ast | |
import random | |
def search_dict(value, dictionary): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Elements Quiz project-fully working program combining all 4.5 components v2 | |
Includes post usability testing changes: | |
Differences to quitting the program | |
Written by Nathan Smith | |
25/08/21""" | |
import ast | |
import random | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Elements Quiz project-fully working program combining all 4.5 components v3 | |
Includes post usability testing changes: | |
Added a second chance for getting the capitalisation wrong on the symbols | |
Also added randomised congratulations messages | |
Written by Nathan Smith | |
25/08/21""" | |
import ast | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webbrowser | |
def biggest_number(): | |
while True: | |
try: | |
num1 = int(input("Enter the first number: ")) | |
num2 = int(input("Enter the second number: ")) | |
except ValueError: | |
print("Those are not numbers, try again ") |
OlderNewer