Skip to content

Instantly share code, notes, and snippets.

View SebGogo's full-sized avatar

Sebastian Gogola SebGogo

View GitHub Profile
@SebGogo
SebGogo / gist:10d121518098914df4e1c40eb599a2ad
Created April 30, 2018 01:41
Learn Python - Student Becomes Teacher
lloyd = {
"name": "Lloyd",
"homework": [90.0, 97.0, 75.0, 92.0],
"quizzes": [88.0, 40.0, 94.0],
"tests": [75.0, 90.0]
}
alice = {
"name": "Alice",
"homework": [100.0, 92.0, 98.0, 100.0],
"quizzes": [82.0, 83.0, 91.0],
@SebGogo
SebGogo / rspGame.py
Created April 29, 2018 23:47
Learn Python - Rock, Paper, Scissors
"""
Learn Python - Rock, Scissors, Paper Game!
"""
from random import randint
options = ["ROCK", "PAPER", "SCISSORS"]
message = {
"tie": "Yawn it's a tie!",
"won": "Yay you won!",
@SebGogo
SebGogo / shopping_list.py
Created April 29, 2018 22:55
Grocery store shopping list
shopping_list = ["banana", "orange", "apple"]
stock = {
"banana": 6,
"apple": 0,
"orange": 32,
"pear": 15
}
prices = {
@SebGogo
SebGogo / planning_trip.py
Created April 29, 2018 17:12
Simple python script for planning a trip
"""
Planning a trip
"""
def hotel_cost(nights):
return 140 * nights
def plane_ride_cost(city):
if city == "Charlotte":
return 183
// Function Expression with variable function's name, ()'s holding two parameters, and {} body
const isGreaterThan = (numberOne, numberTwo) => {
// Conditional statement to see if parameter1 is greater than parameter2
if (numberOne > numberTwo) {
return true;
} else {
return false;
}
// Adding semi colon since we are holding this function within a variable
};
@SebGogo
SebGogo / isGreaterThan.js
Created December 11, 2017 04:21
Function Declarations
// Declaring function with keyword 'function', function's name, ()'s holding two parameters, and {} body
function isGreaterThan (numberOne, numberTwo) {
// Conditional statement to see if parameter1 is greater than parameter2
if (numberOne > numberTwo) {
return true;
} else {
return false;
}
}
@SebGogo
SebGogo / pizza.js
Created December 11, 2017 04:01
Pizza App
// Variable which can change to hold number of pizza orders
let orderCount = 0;
// Function for placing pizza orders including toppings & crust type
const takeOrder = (topping, crustType) => {
// Increment the order numbers by one each time function is called
orderCount++;
// Print the type of pizza ordered after the function is called
console.log(`Orders: ${crustType} pizza topped with ${topping}`);
}
@SebGogo
SebGogo / rockScissorsPaper.js
Created December 10, 2017 21:20
Codecademy - Rock, Scissors, Paper Project
const getUserChoice = (userInput) => {
userInput = userInput.toLowerCase();
if (userInput === 'rock' || userInput === 'paper' || userInput === 'scissors' || userInput === 'bomb') {
return userInput;
}
else {
console.log('Invalid Option');
}
};