@mathieuschnd2/

Presentation

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import random

user_score = 0
user_choice = 0
bot_score = 0
bot_choice = 0

# For a random choice:

# Loop

while (user_score < 3 and bot_score < 3):
  user_choice = input()
  bot_choice = random.choice(["R","S","P","L","O"])

  if user_choice == 'R':
    if bot_choice == 'R':
      print("No one wins")
    elif bot_choice == 'S':
      print("User wins")
    user_score = user_score +1
    elif bot_choice == 'P':
      print("Bot wins")
    bot_score = bot_score +1
    elif user_choice == 'L':
      print("Bot wins")
    bot_score = bot_score +1
    elif user_choice == 'O':
      print("user wins")
    user_score = user_score +1
  
  if user_choice == 'P':
    if bot_choice == 'P':
      print("No one wins")
    elif bot_choice == 'L':
      print("Bot wins")
    user_score = user_score +1
    elif bot_choice == 'S':
      print("Bot wins")
    bot_score = bot_score +1
    elif user_choice == 'R':
      print("Bot wins")
    bot_score = bot_score +1
    elif user_choice == 'O':
      print("user wins")
    user_score = user_score +1
  
  if user_choice == 'S':
    if bot_choice == 'S':
      print("No one wins")
    elif bot_choice == 'R':
      print("User wins")
    user_score = user_score +1
    elif bot_choice == 'P':
      print("Bot wins")
    bot_score = bot_score +1
    elif user_choice == 'L':
      print("Bot wins")
    bot_score = bot_score +1
    elif user_choice == 'O':
      print("user wins")
    user_score = user_score +1
  
  if user_choice == 'L':
    if bot_choice == 'L':
      print("No one wins")
    elif bot_choice == 'S':
      print("User wins")
    user_score = user_score +1
    elif bot_choice == 'R':
      print("Bot wins")
    bot_score = bot_score +1
    elif user_choice == 'P':
      print("Bot wins")
    bot_score = bot_score +1
    elif user_choice == 'O':
      print("Bot wins")
    user_score = user_score +1
  
  if user_choice == 'O':
    if bot_choice == 'O':
      print("No one wins")
    elif bot_choice == 'S':
      print("User wins")
    user_score = user_score +1
    elif bot_choice == 'P':
      print("Bot wins")
    bot_score = bot_score +1
    elif user_choice == 'L':
      print("Bot wins")
    bot_score = bot_score +1
    elif user_choice == 'O':
      print("user wins")
    user_score = user_score +1