This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageTk | |
import tkinter as tk | |
from random import randint | |
notes = ["C", "D", "E", "F", "G", "A", "B", "C", "D", "E", "F", "G"] | |
noteFiles = ["Notes\\middle_c.png", "Notes\\low_d.png", "Notes\\low_e.png", | |
"Notes\\low_f.jpg", "Notes\\low_g.png", "Notes\\a.jpg", | |
"Notes\\b.png", "Notes\\high_c.jpg", "Notes\\high_d.jpg", | |
"Notes\\high_e.png", "Notes\\high_f.jpg", "Notes\\high_g.png"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
import unittest | |
class CoinFlipSimulator(): | |
"""Simulate a coin flip of a specific amount of flips""" | |
def __init__(self, number_of_flips): | |
self.number_of_flips = number_of_flips | |
self.sides_list = [] | |
def simulation(self): | |
"""Perform the actual coin flips""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
class CoinFlipSimulator(): | |
"""Simulate a coin flip of a specific amount of flips""" | |
def __init__(self, number_of_flips): | |
self.number_of_flips = number_of_flips | |
def simulation(self): | |
"""Perform the actual coin flips""" | |
self.sides_list = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
magicians = ['joe', 'bob', 'alberto'] | |
def show_magicians(magicians): | |
for magician in magicians: | |
print magician | |
''' 8-10. Great Magicians: Start with a copy of your program from Exercise 8-9. Write a function called make_great() | |
that modifies the list of magicians by adding the phrase the Great to each magician’s name. Call show_magicians() to see that the | |
list has actually been modified. ''' |