Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 28 additions & 0 deletions problem1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import pandas
import matplotlib.pyplot as plt

game = pandas.read_table('UWvMSU_1-22-13.txt')

game = game.assign(UWscore = 0)
game = game.assign(MSUscore = 0)


if game.loc[0,'team'] == 'UW':
game.loc[0,'UWscore'] += game.loc[0,'score']
if game.loc[0,'team'] == 'MSU':
game.loc[0,'MSUscore'] += game.loc[0,'score']

for row in range(1, len(game)):
game.loc[row,'UWscore'] = game.loc[row - 1, 'UWscore']
game.loc[row,'MSUscore'] = game.loc[row - 1, 'MSUscore']

if game.loc[row,'team'] == 'UW':
game.loc[row,'UWscore'] += game.loc[row,'score']
if game.loc[row,'team'] == 'MSU':
game.loc[row,'MSUscore'] += game.loc[row,'score']

plt.plot(game.time,game.UWscore,'-r',game.time,game.MSUscore,'-b')

#print(len(game))

#print(game)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job.

12 changes: 12 additions & 0 deletions problem2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import numpy

randomNumber = numpy.random.choice(numpy.arange(1,101))
Guess = -1
print("I'm thikning of a number 1-100...")
while Guess != randomNumber:
Guess = input("Guess: ")
if Guess > randomNumber:
print("Lower")
if Guess < randomNumber:
print("Higher")
print("Correct!")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job