-
Notifications
You must be signed in to change notification settings - Fork 0
/
Piedra-Papel-Tijera.py.py
39 lines (36 loc) · 1.01 KB
/
Piedra-Papel-Tijera.py.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
import random
aleatorio = random.randrange(0, 3)
eligePc = ""
print("1)Piedra")
print("2)Papel")
print("3)Tijera")
opcion = int(input("Que eliges: "))
if opcion == 1:
eligeUsuario = "piedra"
elif opcion == 2:
eligeUsuario = "papel"
elif opcion == 3:
elijeUsuario = "tijera"
print("Tu eliges: ", eligeUsuario)
if aleatorio == 0:
eligePc = "piedra"
elif aleatorio == 1:
eligePc = "papel"
elif aleatorio == 2:
eligePc = "tijera"
print("PC eligió: ", eligePc)
print("...")
if eligePc == "piedra" and eligeUsuario == "papel":
print("Ganaste")
elif eligePc == "papel" and eligeUsuario == "tijera":
print("Ganaste")
elif eligePc == "tijera" and eligeUsuario == "piedra":
print("Ganaste")
if eligePc == "papel" and eligeUsuario == "piedra":
print("perdiste")
elif eligePc == "tijera" and eligeUsuario == "papel":
print("perdiste")
elif eligePc == "piedra" and eligeUsuario == "tijera":
print("perdiste")
elif eligePc == eligeUsuario:
print("empate")