Skip to content

Instantly share code, notes, and snippets.

View broschke's full-sized avatar

Bernardo Roschke broschke

View GitHub Profile
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)], end=" ")
print()
class Bassist(Musician): # The Musician class is the parent of the Bassist class
@broschke
broschke / fizzbuzz.py
Created May 17, 2016 13:58
bernardo-fizzbuzz assignment
n = raw_input("Upper limit: ")
n = int(n)
for i in range(1,n):
if i % 3 == 0 and i % 5 == 0:
print 'fizz buzz'
elif i % 5 == 0:
print 'buzz'
elif i % 3 == 0:
print 'fizz'