Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0b26761
moved file
tiff178 Apr 20, 2023
a5aed2a
test if fork works
klpham137 Apr 20, 2023
c5c19be
create tiff branch
tiff178 Apr 21, 2023
2ccd351
test random
klpham137 Apr 21, 2023
6b6460b
deleted some duplicate texts
klpham137 Apr 21, 2023
fc2851a
Merge branch 'tiffany' into katie
tiff178 Apr 21, 2023
cf4ac7a
Update README.md
tiff178 Apr 22, 2023
fc85c20
Update README.md
tiff178 Apr 22, 2023
89b38cf
Update README.md
tiff178 Apr 22, 2023
41932a3
what is the purpose of test.py in project
klpham137 Apr 22, 2023
b749a1b
fixed typo on test.py
klpham137 Apr 22, 2023
c5edb65
Merge branch 'katie' of https://github.com/tiff178/assignment6 into k…
klpham137 Apr 22, 2023
3844314
more changes
klpham137 Apr 22, 2023
32f311c
Merge branch 'master' of https://github.com/tiff178/assignment6
klpham137 Apr 22, 2023
ff0a2ef
testing
Apr 22, 2023
c69b3dd
analyze virtual_pet.py
Apr 22, 2023
eb4c723
organize files
klpham137 Apr 22, 2023
c672d1d
Merge branch 'katie'
klpham137 Apr 22, 2023
040cf92
create a draw_net method (refactor piece of code)
Apr 23, 2023
2c4721d
create draw_net2 (refactoring(
Apr 23, 2023
8dc552a
changes
Apr 23, 2023
709ef6e
testing master sync again
klpham137 Apr 23, 2023
7ae08c1
refactored net2 (works!)
klpham137 Apr 23, 2023
6658c2f
test again
Apr 23, 2023
c120150
net part 3 refactored in graphicsv4!
Apr 23, 2023
4c3b720
refactor vertical lines on middle left of the net
klpham137 Apr 23, 2023
0bb6f5f
refactoring parts of net part 1 middle vert lines
klpham137 Apr 23, 2023
8742980
finished refactoring all vertical lines of middle part of net
klpham137 Apr 23, 2023
0f26c2c
completed refactoring lights + net graphics_v1
klpham137 Apr 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed 2015-12-07_Drawing with Pygame/graph.pdf
Binary file not shown.
36 changes: 18 additions & 18 deletions String Demo/hangman_v1.py → Demo/hangman_v1.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
word = "patriots"
solved = "-" * len(word)
guesses = ""
print("Let's play Hangman!")
print(solved)
while word != solved:
guesses += input("Guess a letter: ")
for i in range(len(word)):
if word[i] in guesses:
solved = solved[:i] + word[i] + solved[i+1:]
print(solved)
print("You win!")
word = "patriots"
solved = "-" * len(word)
guesses = ""

print("Let's play Hangman!")
print(solved)

while word != solved:
guesses += input("Guess a letter: ")

for i in range(len(word)):
if word[i] in guesses:
solved = solved[:i] + word[i] + solved[i+1:]

print(solved)

print("You win!")

54 changes: 27 additions & 27 deletions Lists/list_demo.py → Demo/list_demo.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# make a list
nums = [3, 1, 4, 1, 5, 9]
# find the length of a list
print( len(nums) )
# select individual items from a list
begin = nums[0]
end = nums[-1]
print(begin, end)
# get a "slice" of a list
print( nums[:3] )
print( nums[3:] )
print( nums[2:4] )
# lists can contain strings
names = ["Terry Gilliam", "Michael Palin", "Eric Idle", "Terry Jones", "John Cleese", "Graham Chapman"]
print(len(names))
print(names)
# select a random element from a list
import random
print(random.choice(names))
# make a list
nums = [3, 1, 4, 1, 5, 9]

# find the length of a list
print( len(nums) )

# select individual items from a list
begin = nums[0]
end = nums[-1]

print(begin, end)

# get a "slice" of a list
print( nums[:3] )
print( nums[3:] )
print( nums[2:4] )

# lists can contain strings
names = ["Terry Gilliam", "Michael Palin", "Eric Idle", "Terry Jones", "John Cleese", "Graham Chapman"]
print(len(names))
print(names)

# select a random element from a list
import random
print(random.choice(names))


88 changes: 44 additions & 44 deletions Lists/list_with_loops.py → Demo/list_with_loops.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
animals = ['dog', 'mouse', 'cat', 'horse', 'octopus']
print(len(animals))
print(animals[0])
i = 0
while i < len(animals):
print(animals[i])
i += 1
"""
for every animal in the list called animals:
print the animal
for every animal, a, in animals:
print(a)
"""
for a in animals:
print(a)
# print animals with three letters
for a in animals:
if len(a) == 3:
print(a)
# count animals with three letters
count = 0
for a in animals:
if len(a) == 3:
count += 1
print(count)
# count animals without three letters
count = 0
for a in animals:
if len(a) != 3:
count += 1
print(count)
animals = ['dog', 'mouse', 'cat', 'horse', 'octopus']

print(len(animals))
print(animals[0])

i = 0

while i < len(animals):
print(animals[i])
i += 1


"""
for every animal in the list called animals:
print the animal


for every animal, a, in animals:
print(a)
"""

for a in animals:
print(a)


# print animals with three letters
for a in animals:
if len(a) == 3:
print(a)


# count animals with three letters
count = 0
for a in animals:
if len(a) == 3:
count += 1
print(count)

# count animals without three letters
count = 0
for a in animals:
if len(a) != 3:
count += 1
print(count)
28 changes: 14 additions & 14 deletions intro to Python/math_demo.py → Demo/math_demo.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# this program demonstrates how to use the math module
#
# jordan houle
# december 3, 2015
import math
#the math module has constants
print(math.pi)
print(math.e)
#the math module also has built in functions
print(math.sqrt(2))
print(math.sin(0.5))
# this program demonstrates how to use the math module
#
# jordan houle
# december 3, 2015

import math

#the math module has constants
print(math.pi)
print(math.e)

#the math module also has built in functions
print(math.sqrt(2))
print(math.sin(0.5))
68 changes: 34 additions & 34 deletions String Demo/string_demo.py → Demo/string_demo.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
pangram = "The quick brown fox jumps over the lazy dog."
print(pangram)
# find the length of a string
num_chars = len(pangram)
print(num_chars)
# select individual characters from a string
first = pangram[0]
twelve = pangram[12]
last = pangram[num_chars - 1]
also_last = pangram[-1]
print(first, twelve, last, also_last)
# what if we try to look outside of the range?
# uncomment lines below to test
#print( pangram[-4] )
#print( pangram[50] )
# get a "slice" of a string
print( pangram[4:12] )
print( pangram[0:12] )
print( pangram[:12] )
print( pangram[12:] )
print( pangram[12:-1] )
print( pangram[12:len(pangram)] )
# get the index of a string within a string
print(pangram.find('q'))
print(pangram.find('T'))
print(pangram.find('fox'))
print(pangram.find('B'))
pangram = "The quick brown fox jumps over the lazy dog."

print(pangram)

# find the length of a string
num_chars = len(pangram)
print(num_chars)

# select individual characters from a string
first = pangram[0]
twelve = pangram[12]
last = pangram[num_chars - 1]
also_last = pangram[-1]

print(first, twelve, last, also_last)

# what if we try to look outside of the range?
# uncomment lines below to test
#print( pangram[-4] )
#print( pangram[50] )

# get a "slice" of a string
print( pangram[4:12] )
print( pangram[0:12] )
print( pangram[:12] )
print( pangram[12:] )
print( pangram[12:-1] )
print( pangram[12:len(pangram)] )

# get the index of a string within a string
print(pangram.find('q'))
print(pangram.find('T'))
print(pangram.find('fox'))
print(pangram.find('B'))
2 changes: 1 addition & 1 deletion File IO/file_io_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@
with open('two_letters.txt', 'w') as f:
for w in words:
if len(w) == 2
f.write(w + "\n")
f.write(w + "\n");
Loading