MacSG

LabComPro-Mid_1

Mar 29th, 2015
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. def who_win(round_a, round_b):
  2.  
  3.     score_1 = 0
  4.     score_2 = 0
  5.  
  6.     if round_a[0] > round_a[1]:
  7.         score_1 += 1
  8.     elif round_a[0] < round_a[1]:
  9.         score_2 += 1
  10.     else:
  11.         pass
  12.     if round_b[0] > round_b[1]:
  13.         score_1 += 1
  14.     elif round_b[0] < round_b[1]:
  15.         score_2 += 1
  16.     else:
  17.         pass
  18.  
  19.     if score_1 > score_2:
  20.         print("1 win")
  21.     elif score_1 < score_2:
  22.         print("2 win")
  23.     else:
  24.         print("draw")
  25.  
  26. #Main Program
  27. who_win((5,4),(10,10))
  28. who_win((1,1),(2,2))
  29. who_win((1,2),(2,2))
Advertisement
Add Comment
Please, Sign In to add comment