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
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 |
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
# 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 |
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
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 |
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
# 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' |
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 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") |
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
/* 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 |
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 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 |
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 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)) |
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 | |
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 |
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
-- 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 |
NewerOlder