This file contains hidden or 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
| #!python3.9 | |
| from time import sleep | |
| from typing import Optional | |
| import requests | |
| from urllib.parse import urlencode | |
| HEADERS = { | |
| "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", | |
| "Content-Type": "application/x-www-form-urlencoded", | |
| "Origin": "https://www.oracleofbacon.org", |
This file contains hidden or 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
| for file in `find .`; | |
| do if [ "${file: -3}" == ".py" ]; | |
| then echo -e $file\\n >> $file.txt && echo -e "`nl -ba $file`" >> $file.txt; | |
| fi; | |
| done |
This file contains hidden or 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
| # Skeleton Program code for the AQA A Level Paper 1 Summer 2019 examination | |
| # this code should be used in conjunction with the Preliminary Material | |
| # written by the AQA Programmer Team | |
| # and me lol © | |
| # developed in the Python 3.5.1 programming environment | |
| import random | |
| import pickle | |
| import os |
This file contains hidden or 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
| # Skeleton Program code for the AQA A Level Paper 1 Summer 2019 examination | |
| # this code should be used in conjunction with the Preliminary Material | |
| # written by the AQA Programmer Team | |
| # and me lol © | |
| # developed in the Python 3.5.1 programming environment | |
| import random | |
| import pickle | |
| import os |
This file contains hidden or 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
| # Skeleton Program code for the AQA A Level Paper 1 Summer 2019 examination | |
| # this code should be used in conjunction with the Preliminary Material | |
| # written by the AQA Programmer Team | |
| # and me lol © | |
| # developed in the Python 3.5.1 programming environment | |
| import random | |
| import pickle | |
| import os |
This file contains hidden or 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
| # Skeleton Program code for the AQA A Level Paper 1 Summer 2019 examination | |
| # this code should be used in conjunction with the Preliminary Material | |
| # written by the AQA Programmer Team | |
| # and me lol © | |
| # developed in the Python 3.5.1 programming environment | |
| import random | |
| import pickle | |
| import os |
This file contains hidden or 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
| from modules.data_structures.graph.graph import Graph | |
| from modules.data_structures.maze.maze.maze_protocol import MazeProtocol | |
| from modules.data_structures.maze.maze_cell.maze_cell import MazeCell | |
| from typing import Dict, Tuple | |
| class Maze(MazeProtocol): | |
| """The protocol for any Maze object to conform to. | |
| Args: |
This file contains hidden or 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
| from typing import List | |
| """ | |
| Adjacency Matrix | |
| 1. Create a matrix A of size NxN and initialise it with zero. | |
| 2. Iterate over each given edge of the form (u,v) and assign 1 to A[u][v]. Also, If graph is undirected then assign 1 to A[v][u]. | |
| """ | |
| class Graph: | |
| adjacencyMatrix: List[List] |
This file contains hidden or 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 csv | |
| import enum | |
| def average(numbers: list): | |
| average: float = 0 | |
| for number in numbers: | |
| average += number | |
| average /= len(numbers) |
This file contains hidden or 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
| graph: dict = { | |
| "A": {"colour": "White", "neighbours": ["B", "D", "E"]}, | |
| "B": {"colour": "White", "neighbours": ["A", "D", "C"]}, | |
| "C": {"colour": "White", "neighbours": ["B", "G"]}, | |
| "D": {"colour": "White", "neighbours": ["A", "B", "E", "F"]}, | |
| "E": {"colour": "White", "neighbours": ["A", "D"]}, | |
| "F": {"colour": "White", "neighbours": ["D"]}, | |
| "G": {"colour": "White", "neighbours": ["C"]} | |
| } |
NewerOlder