diff --git a/Ex6_1.py b/Ex6_1.py new file mode 100644 index 0000000..1cbe453 --- /dev/null +++ b/Ex6_1.py @@ -0,0 +1,29 @@ +cd Desktop/Intro_Biocom_ND_319_Tutorial6 + +import pandas as pd +import numpy as np + +score=pd.read_table("UWvMSU_1-22-13.txt") +A=np.zeros((len(score),3)) +B=pd.DataFrame(A, columns=['time','UW_score','MSU_score']) +B.time=score.time + +temp_UW=0 +temp_MSU=0 + +for i in range(0,len(score),1): + if score.team[i] == "UW": + temp_UW += score.score[i] + B.UW_score[i] = temp_UW + B.MSU_score[i] = temp_MSU + else: + temp_MSU += score.score[i] + B.MSU_score[i] = temp_MSU + B.UW_score[i] = temp_UW + +import matplotlib.pyplot as plt +score_plot=plt.step(B.time, B.UW_score, 'r-', B.time, B.MSU_score, 'g-') +plt.suptitle("UW vs MSU -- Jan 22, 2013") +plt.xlabel("time") +plt.ylabel("cumulative score") +plt.savefig("UWvMSU_score.png") diff --git a/Ex6_2.py b/Ex6_2.py new file mode 100755 index 0000000..10b939e --- /dev/null +++ b/Ex6_2.py @@ -0,0 +1,29 @@ +import numpy as np +numbers=np.arange(100)+1 +answer=np.random.choice(numbers) +guess=0 +name= raw_input ("What is your name?") +print("Wanna play a game %s?") %(name) +print("Guess a number 1-100") +while guess!= answer: + guess = input ("Your guess is:") + if guess > 0: + if guess > answer: + print "Lower" + else: + print "Higher" + else: + break +else: + print ("Congrats %s, you win....this time") %(name) + + + + + + + + + + + diff --git a/UWvMSU_score.png b/UWvMSU_score.png new file mode 100644 index 0000000..0710876 Binary files /dev/null and b/UWvMSU_score.png differ