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
""" | |
1) python -m venv selenium_test | |
2) /selenium_test/Scripts/activate | |
3) pip install selenium | |
""" | |
from selenium import webdriver | |
driver = webdriver.Chrome() | |
driver.get('https://www.google.com') |
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
from itertools import groupby | |
def run_length_encoding(s: str) -> str: | |
return ''.join(f"{len(list(group))}{key}" for key, group in groupby(s)) | |
s = "aaabbccccdeee" | |
grouped = groupby(s) | |
for key, group in grouped: | |
print(f"Key: {key}, Group: {list(group)}") |
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 math | |
import matplotlib.pyplot as plt | |
def distance(x1, y1, x2, y2): | |
return math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2) | |
def is_triangle_non_degenerate(ax, ay, bx, by, cx, cy): | |
# Calculate the lengths of the sides |
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
from num2words import num2words | |
numbers = list(range(10,100)) | |
number_to_word_dict = {num : num2words(num) for num in numbers} | |
sorted_numbers = sorted(numbers, key = lambda x : number_to_word_dict[x]) | |
print(sorted_numbers) |
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 pandas as pd | |
import github as Github | |
def get_repo_information(org_name, access_token): | |
git = Github(access_token) | |
org = git.get_organization(org_name) | |
repositories = org.get_repos() | |
data = [] |
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
Monkey 0: | |
Starting items: 78, 53, 89, 51, 52, 59, 58, 85 | |
Operation: new = old * 3 | |
Test: divisible by 5 | |
If true: throw to monkey 2 | |
If false: throw to monkey 7 | |
Monkey 1: | |
Starting items: 64 | |
Operation: new = old + 7 |
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
def fetch_input(file) -> str: | |
''' Fetches the txt file input for the current challenge ''' | |
with open(file, 'r') as file: | |
data = file.read().replace('\n', '') | |
return data | |
def check_start_of_packet(txt,window_length) -> bool: | |
''' Determine if current text is all unique characters ''' |
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
16-80,80-87 | |
4-9,10-97 | |
6-94,93-93 | |
31-73,8-73 | |
4-72,5-73 | |
6-63,4-5 | |
3-44,4-45 | |
89-96,95-95 | |
56-95,29-95 | |
5-22,5-22 |
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
BdbzzddChsWrRFbzBrszbhWMLNJHLLLLHZtSLglFNZHLJH | |
nnfMwqpQTMffHlNNLllHnZSS | |
cGpcMwfppfqcjcTCBBzWDsDbDrjzWz | |
LhfjhcdjcGdhFfdGfdjdvwCCZMvvLvWwMLCLSwZC | |
rDnsbmptPmlbQMCrQWQQBZQW | |
gltgVPngDPbptPsbPzVgmDldfTdfczThjJJjfMcJdFHjjH | |
dGlgDflTLLLrRLTLVdQLcQMnbvHbbFzNNvMbnHHn | |
sZjWJJCSjWqfCqSjSmJSbFvCzBMBBzHncHNvMBHN | |
twqqwpZwfrlwRwDGDR | |
zCGGFTQMQrsNRNGZdR |
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
BdbzzddChsWrRFbzBrszbhWMLNJHLLLLHZtSLglFNZHLJH | |
nnfMwqpQTMffHlNNLllHnZSS | |
cGpcMwfppfqcjcTCBBzWDsDbDrjzWz | |
LhfjhcdjcGdhFfdGfdjdvwCCZMvvLvWwMLCLSwZC | |
rDnsbmptPmlbQMCrQWQQBZQW | |
gltgVPngDPbptPsbPzVgmDldfTdfczThjJJjfMcJdFHjjH | |
dGlgDflTLLLrRLTLVdQLcQMnbvHbbFzNNvMbnHHn | |
sZjWJJCSjWqfCqSjSmJSbFvCzBMBBzHncHNvMBHN | |
twqqwpZwfrlwRwDGDR | |
zCGGFTQMQrsNRNGZdR |
NewerOlder