Advertisement
bl00dt3ars

Sample

Jun 6th, 2021
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.14 KB | None | 0 0
  1. line_one = input().split()
  2. line_two = input().split()
  3. line_tree = input().split()
  4. won = 0
  5. line_one = [int(x) for x in line_one]
  6. line_two = [int(x) for x in line_two]
  7. line_tree = [int(x) for x in line_tree]
  8. for x in range(len(line_one)):
  9.     if line_one[x] == line_two[x] == line_tree[x]:
  10.         if line_one[x] == 1:
  11.             won = "First"
  12.         elif line_one[x] == 2:
  13.             won = "Second"
  14.  
  15. if all(line_one):
  16.     if line_one[0] == 1:
  17.         won = "First"
  18.     elif line_one[0] == 2:
  19.         won = "Second"
  20.  
  21. if all(line_two):
  22.     if line_two[0] == 1:
  23.         won = "First"
  24.     elif line_two[0] == 2:
  25.         won = "Second"
  26.  
  27. if all(line_tree):
  28.     if line_tree[0] == 1:
  29.         won = "First"
  30.     elif line_tree[0] == 2:
  31.         won = "Second"
  32.  
  33. if line_one[0] == line_two[1] == line_tree[2]:
  34.     if line_one[0] == 1:
  35.         won = "First"
  36.     elif line_one[0] == 2:
  37.         won = "Second"
  38.  
  39. if line_one[2] == line_two[1] == line_tree[0]:
  40.     if line_one[2] == 1:
  41.         won = "First"
  42.     elif line_one[2] == 2:
  43.         won = "Second"
  44.  
  45. if won == 0:
  46.     print("Draw!")
  47. else:
  48.     print(f"{won} player won")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement