Skip to content

Instantly share code, notes, and snippets.

View magi196502's full-sized avatar

Macy Graham-Kimbrough magi196502

View GitHub Profile
@magi196502
magi196502 / index.html
Created January 31, 2019 20:24
Raindrops
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.3/p5.js"></script>
<script src="sketch.js"></script>
</head>
<body>
</body>
</html>
@magi196502
magi196502 / Basta Fazoolin'
Created November 12, 2018 16:12
Project to demonstrate classes and objects
class Menu:
# The constructor for the menu class.
# Define the initial values for the menu items
def __init__(self, name, items, start_time, end_time):
self.name = name
self.items = items
self.start_time = start_time
self.end_time = end_time
# Define the string representation for the menus
@magi196502
magi196502 / Area of a circle - Python
Last active November 11, 2018 12:17 — forked from codecademydev/script.py
Codecademy export
class Circle:
pi = 3.14
def __init__(self, diameter):
self.radius = diameter / 2
def area(self):
return self.pi * self.radius ** 2
def circumference(self):
@magi196502
magi196502 / script.py
Created November 8, 2018 22:51 — forked from codecademydev/script.py
Codecademy export
hairstyles = ["bouffant", "pixie", "dreadlocks", "crew", "bowl", "bob", "mohawk", "flattop"]
prices = [30, 25, 40, 20, 20, 35, 50, 35]
last_week = [2, 3, 5, 8, 4, 4, 6, 2]
total_price = 0
for price in prices:
total_price += price
@magi196502
magi196502 / script.py
Created November 8, 2018 22:50 — forked from codecademydev/script.py
Codecademy export
toppings = ['pepperoni', 'pineapple', 'cheese', 'sausage', 'olives', 'anchovies', 'mushrooms']
prices = [2, 6, 1, 3, 2, 7, 2]
num_pizzas = len(toppings)
print("We sell " + str(num_pizzas) + " different kinds of pizza!")
pizzas = list(zip(prices, toppings))
print(pizzas)
pizzas.sort()
cheapest_pizza = pizzas[0]
priciest_pizza = pizzas[-1]
three_cheapest = pizzas[:3]
@magi196502
magi196502 / scrabble.py
Created November 8, 2018 22:45 — forked from codecademydev/scrabble.py
Codecademy export
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 = {key.upper():value for key, value in zip(letters,points)}
letter_to_points[" "] = 0
print(letter_to_points)
@magi196502
magi196502 / script.py
Created November 8, 2018 22:44 — forked from codecademydev/script.py
Codecademy export
destinations = ["Paris, France", "Shanghai, China", "Los Angeles, USA", "So Paulo, Brazil", "Cairo, Egypt"]
test_traveler = ['Erin Wilkes', 'Shanghai, China', ['historical site', 'art']]
def get_destination_index(destination):
"""
destination_index = -1
for i in range(len(destinations)):
if destination == destinations[i]:
return i
@magi196502
magi196502 / script.py
Created November 8, 2018 22:43 — forked from codecademydev/script.py
Codecademy export
daily_sales = \
"""Edith Mcbride ;,;$1.21 ;,; white ;,;
09/15/17 ,Herbert Tran ;,; $7.29;,;
white&blue;,; 09/15/17 ,Paul Clarke ;,;$12.52
;,; white&blue ;,; 09/15/17 ,Lucille Caldwell
;,; $5.13 ;,; white ;,; 09/15/17,
Eduardo George ;,;$20.39;,; white&yellow
;,;09/15/17 , Danny Mclaughlin;,;$30.82;,;
purple ;,;09/15/17 ,Stacy Vargas;,; $1.85 ;,;
purple&yellow ;,;09/15/17, Shaun Brock;,;
@magi196502
magi196502 / app.js
Created November 8, 2018 19:58 — forked from codecademydev/app.js
Codecademy export
// Set human age
const myAge = 41;
// Set early years
let earlyYears = 2;
// Multiply the early years by 10.5
earlyYears *= 10.5;
// Subtract 2 from current age since the age for
@magi196502
magi196502 / app.js
Created November 8, 2018 19:37 — forked from codecademydev/app.js
Codecademy export
// Define the initial value of kelvin and
// set to 293 degrees kelvin
const kelvin = 293;
// convert degrees kelvin to degrees celcius by subtracting 273
const celsius = kelvin - 273;
// Convert to degrees fahrenheit and round down
let fahrenheit = Math.floor(celsius * (9/5) + 32);
console.log(`The temperature ${kelvin} is ${fahrenheit} degrees Fahrenheit.`);