Skip to content

Instantly share code, notes, and snippets.

@Mathsmaniac
Mathsmaniac / RecapExercises.py
Created February 3, 2022 22:38
Exercises to recap year 11 that are boring and easy and I didn't finsih because I have better things to do
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 ")
@Mathsmaniac
Mathsmaniac / Elements Quizv3.py
Last active August 25, 2021 02:32
Added a second chance for getting the capitalisation wrong on the symbols also added randomised congratulations messages
"""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
@Mathsmaniac
Mathsmaniac / Elements Quizv2.py
Created August 25, 2021 00:13
Fully working program v2 with differences to quitting the program
"""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
@Mathsmaniac
Mathsmaniac / Elements Quizv1.py
Created August 24, 2021 22:58
First version of fully working program, not tested for usability
"""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):
@Mathsmaniac
Mathsmaniac / 04end_summary.py
Created August 24, 2021 22:58
Quits the program and tells the user what they have got right and wrong
"""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
@Mathsmaniac
Mathsmaniac / 03get_answer.py
Created August 24, 2021 22:57
Checks the users response against a model answer
"""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 = []
@Mathsmaniac
Mathsmaniac / 03.5spell_check.py
Created August 24, 2021 01:44
This program checks a response agianst a model response and sees whether there were accidental mistakes in it
"""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"""
@Mathsmaniac
Mathsmaniac / 01select_difficulty.py
Last active August 22, 2021 20:52
Gets the difficulty the user wants to play at and links that with the corresponding elements
"""Component 1 of elements Quiz project - selecting the difficulty
Gets the difficulty the user wants to play at
And links that with the corresponding elements
Written by Nathan Smith
05/08/2021"""
import ast
# Making sure that the input is valid and
@Mathsmaniac
Mathsmaniac / 02make_question.py
Created August 22, 2021 20:51
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
"""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
@Mathsmaniac
Mathsmaniac / Lucky_Unicorn_v4.py
Created July 22, 2021 08:38
Added round counter and included round details in feedback to player
"""Lucky Unicorn - fully working program, combining all 4 components v3
Added round counter and included round details in feedback to player
Created by Nathan Smith
28/06/21
"""
import random
# Integer checking function