Skip to content

Instantly share code, notes, and snippets.

Macy Graham-Kimbrough magi196502

Block or report user

Report or block magi196502

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Area of a circle - Python
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 Nov 8, 2018 — forked from codecademydev/script.py
Codecademy export
View script.py
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 Nov 8, 2018 — forked from codecademydev/script.py
Codecademy export
View script.py
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 Nov 8, 2018 — forked from codecademydev/scrabble.py
Codecademy export
View scrabble.py
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 Nov 8, 2018 — forked from codecademydev/script.py
Codecademy export
View script.py
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 Nov 8, 2018 — forked from codecademydev/script.py
Codecademy export
View script.py
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 Nov 8, 2018 — forked from codecademydev/app.js
Codecademy export
View app.js
// 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 Nov 8, 2018 — forked from codecademydev/app.js
Codecademy export
View app.js
// 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.`);
@magi196502
magi196502 / script.py
Created Nov 8, 2018 — forked from codecademydev/script.py
Codecademy export
View script.py
train_mass = 22680
train_acceleration = 10
train_distance = 100
bomb_mass = 1
def f_to_c(f_temp):
c_temp = (f_temp - 32) * 5/9
return c_temp
f100_in_celsius = f_to_c(100)
@magi196502
magi196502 / script.py
Last active Nov 8, 2018 — forked from codecademydev/script.py
Codecademy export
View script.py
def ground_shipping(weight):
if weight > 10.0:
return weight * 4.75 + 20.0
elif weight > 6.0 and weight <= 10.0:
return weight * 4.00 + 20.0
elif weight > 2.0 and weight <= 6.0:
return weight * 3.00 + 20.0
else:
return weight * 1.50 + 20.0
You can’t perform that action at this time.