Skip to content

Instantly share code, notes, and snippets.

@MrN00b0t
MrN00b0t / pokemon.py
Created June 15, 2020 11:22
Codecademy: Become a Pokemon Master
class Pokemon:
def __init__(self, name='Default', level=1, element='Grass', maxhealth=100, curr_health=10, concious=True, attack=1, defence=1, speed=1):
self.name = name
self.level = level
self.element = element
self.maxhealth = maxhealth
self.curr_health = curr_health
self.concious = concious
self.attack = attack
self.defence = defence
@MrN00b0t
MrN00b0t / hurricane.py
Last active June 10, 2020 16:19
Codecademy: Hurricane Analysis
# names of hurricanes
names = ['Cuba I', 'San Felipe II Okeechobee', 'Bahamas', 'Cuba II', 'CubaBrownsville', 'Tampico', 'Labor Day', 'New England', 'Carol', 'Janet', 'Carla', 'Hattie', 'Beulah', 'Camille', 'Edith', 'Anita', 'David', 'Allen', 'Gilbert', 'Hugo', 'Andrew', 'Mitch', 'Isabel', 'Ivan', 'Emily', 'Katrina', 'Rita', 'Wilma', 'Dean', 'Felix', 'Matthew', 'Irma', 'Maria', 'Michael']
# months of hurricanes
months = ['October', 'September', 'September', 'November', 'August', 'September', 'September', 'September', 'September', 'September', 'September', 'October', 'September', 'August', 'September', 'September', 'August', 'August', 'September', 'September', 'August', 'October', 'September', 'September', 'July', 'August', 'September', 'October', 'August', 'September', 'October', 'September', 'September', 'October']
# years of hurricanes
years = [1924, 1928, 1932, 1932, 1933, 1933, 1935, 1938, 1953, 1955, 1961, 1961, 1967, 1969, 1971, 1977, 1979, 1980, 1988, 1989, 1992, 1998, 2003, 2004, 2005, 2005, 2005, 2
@MrN00b0t
MrN00b0t / scrabble.py
Last active June 10, 2020 10:07
Codecademy: Scrabble project
letters = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
points = [1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 5, 1, 3, 4, 1, 3, 10, 1, 1, 1, 1, 4, 4, 8, 4, 10]
letter_to_points = {letter:point for letter, point in zip(letters,points)}
#add lower case letter point values
letter_to_points.update({letter.lower():point for letter, point in zip(letters, points)})
letter_to_points[' '] = 0
#Establish the score of a given word
def score_word (word):
point_total = 0
@MrN00b0t
MrN00b0t / censor.py
Last active June 10, 2020 09:21
Codecademy: Censor Dispenser
# These are the emails you will be censoring. The open() function is opening the text file that the emails are contained in and the .read() method is allowing us to save their contexts to the following variables:
email_one = open("email_one.txt", "r").read()
email_two = open("email_two.txt", "r").read()
email_three = open("email_three.txt", "r").read()
email_four = open("email_four.txt", "r").read()
#list of terms provided in challenge 2
proprietary_terms = ["she", "personality matrix", "sense of self", "self-preservation", "learning algorithm", "her", "herself"]
#list of terms provided in challenge three. I added 'distressing'
@MrN00b0t
MrN00b0t / soupclean.py
Last active May 19, 2020 09:54
Codecademy: Beautiful Soup Review
import requests
from bs4 import BeautifulSoup
import pandas as pd
prefix = "https://s3.amazonaws.com/codecademy-content/courses/beautifulsoup/"
webpage_response = requests.get('https://s3.amazonaws.com/codecademy-content/courses/beautifulsoup/shellter.html')
webpage = webpage_response.content
soup = BeautifulSoup(webpage, "html.parser")
@MrN00b0t
MrN00b0t / learners_mock.sqlite
Created May 18, 2020 14:40
Codecademy: Learners Mockup Data
/* Top 25 Schools using an app */
SELECT email_domain, COUNT(user_id) as no_of_users
FROM users
GROUP BY 1
ORDER BY 2 DESC
LIMIT 25;
/* Count number of users in New York */
SELECT city, COUNT(user_id) as no_of_users
FROM users
@MrN00b0t
MrN00b0t / games_of_chance.py
Created May 18, 2020 11:34
Codecademy: Games of Chance Python Project
import random
money = 100
#Write your game of chance functions here
def coin_toss(guess, bet):
if bet > money:
print('You don\'t have enough green to place that bet!')
print('The maximum bet you can make is £' + str(money))
return 0
@MrN00b0t
MrN00b0t / coasters.py
Created May 11, 2020 13:54
Codecademy: Roller Coaster
import codecademylib3_seaborn
import pandas as pd
import matplotlib.pyplot as plt
# load rankings data here:
wood_coaster = pd.read_csv('Golden_Ticket_Award_Winners_Wood.csv')
steel_coaster = pd.read_csv('Golden_Ticket_Award_Winners_Steel.csv')
#Examine datasets
print(wood_coaster.head(5))
@MrN00b0t
MrN00b0t / script.py
Created May 7, 2020 10:24
Codecademy: This is Jeopardy!
import pandas as pd
pd.set_option('display.max_colwidth', -1)
#Load csv into Data Frame
jeopardy = pd.read_csv('jeopardy.csv')
#Investigate DataFrame Structure
print(jeopardy.head())
#Does not show full DataFrame; try different method
@MrN00b0t
MrN00b0t / worldpop.sqlite
Last active May 1, 2020 10:24
Codecademy: World Populations SQL Practice Solution
-- This is the first query:
SELECT DISTINCT year from population_years;
-- Add your additional queries below:
SELECT ROUND(MAX(population), 2) AS 'Largest Population of Gabon in Dataset (mil)'
FROM population_years
WHERE country = 'Gabon';
SELECT country AS 'Countries with Smallest Populations in 205 (Ascending)'
FROM population_years