diff --git a/problem1.py b/problem1.py new file mode 100644 index 0000000..ed4bd1f --- /dev/null +++ b/problem1.py @@ -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) diff --git a/problem2.py b/problem2.py new file mode 100644 index 0000000..033b59c --- /dev/null +++ b/problem2.py @@ -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!") \ No newline at end of file