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
#I McTavish | |
#Oct 28, 2016 | |
#Demonstrate Lists | |
goals_game1 = 3 | |
goals_game2 = 5 | |
goals_game3 = 2 | |
goals_game4 = 1 | |
goals_game5 = 0 |
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
#I McTavish | |
#Oct 28, 2016 | |
#Demonstrate Lists | |
goals_game = [3,5,2,1,0] | |
totalgoals = 0; | |
for x in range(len(goals_game)): | |
totalgoals += goals_game[x] | |
print(totalgoals) |
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
#I McTavish | |
#Oct 27, 2016 | |
#Use Lists | |
#Create a list of strings | |
list1 = ['Drew','Sherriee','Lonny','Stacee'] | |
#output full list | |
print(list1) |
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
#I McTavish | |
#Oct. 2016 | |
#Demonstrate arrays with complex data types | |
class Aliens: | |
"""Aliens class - represents an alien in a video game""" | |
def __init__(self, x, y): | |
"""x, y are the starting positions""" | |
self.x = x | |
self.y = y | |
self.speed = 10 |
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
<component name="InspectionProjectProfileManager"> | |
<profile version="1.0"> | |
<option name="myName" value="Project Default" /> | |
<inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true"> | |
<option name="ignoredErrors"> | |
<list> | |
<option value="W29" /> | |
<option value="E501" /> | |
</list> | |
</option> |
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
#Name | |
#Date | |
#Add global variable - a list of addresses | |
#open button should open a set text file | |
#and load addresses | |
#close should save using the list | |
#When open first item displayed | |
#next moves to next item | |
import tkinter |
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
#I McTavish | |
#Nov 2, 2016 | |
#Demonstrate methods with temp convertor | |
def convert_c_to_f(c): | |
"""Method to convert Celsius to Fahrenheit | |
Pre: Celsius temp | |
Post: Fahrenheit temp""" | |
f = 9/5*c+32 | |
return format(f,".2f") |
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
#I McTavish | |
#Nov 3, 2016 | |
#Create a template for hangman game. | |
import tkinter | |
from tkinter import font | |
class MyGUI: | |
"""The class that handles the window""" | |
def __init__(self): | |
#main window |
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
#I McTavish | |
#Nov 3, 2016 | |
#Create a template for hangman game. | |
import tkinter | |
from tkinter import font | |
class MyGUI: | |
"""The class that handles the window""" | |
def __init__(self): | |
#main window |