Skip to content

Instantly share code, notes, and snippets.

View j10sanders's full-sized avatar
😤

Jonathan Sanders j10sanders

😤
View GitHub Profile
__author__ = 'Jonathan'
class Bicycle(object):
def __init__(self, modelname, weight, cost):
self.modelname = modelname
self.weight = weight
self.cost = cost
class BikeShop(object):
def __init__(self, name, inventory, prod_cost):
__author__ = 'Jonathan'
class Musician(object):
def __init__(self, sounds):
self.sounds = sounds
def solo(self, length):
for i in range(length):
print(self.sounds[i % len(self.sounds)],)
print("")
__author__ = 'Jonathan'
import random
questions = {
"strong": "Do ye like yer drinks strong?",
"salty": "Do ye like it with a salty tang?",
"bitter": "Are ye a lubber who likes it bitter?",
"sweet": "Would ye like a bit of sweetness with yer poison?",
"fruity": "Are ye one for a fruity finish?"
__author__ = 'Jonathan'
while True:
try:
biggestnum = int(input("How many numbers should we count to? "))
if biggestnum <= 0:
raise ValueError
break
except ValueError:
print("That's not a positive integer.")