Skip to content

Instantly share code, notes, and snippets.

@chuongmep

chuongmep/buabaokeo.py

Last active May 10, 2021
Embed
What would you like to do?
from random import randint
print ("Quy uoc Bao :0")
print ("Quy uoc Bua :1")
print ("Quy uoc Keo :2")
lst = ["Bao","Bua","Keo"]
computer = randint(0,2)
userinput = int (input ("Moi ban nhap: \n"))
print ("Nguoi dung da nhap",lst[userinput])
print ("May nhap",lst[computer])
matrix = [["Hoa","Thua","Thang"],
["Thang","Hoa","Thua"],
["Thua","Thang","Hoa"]]
print ("Ket Qua",matrix[computer][userinput])
from random import randint
print ("Quy uoc Bao :0")
print ("Quy uoc Bua :1")
print ("Quy uoc Keo :2")
lst = ["Bao","Bua","Keo"]
computer = randint(0,2)
userinput = int (input ("Moi ban nhap: \n"))
print ("Nguoi dung da nhap",lst[userinput])
print ("May nhap",lst[computer])
mx = [[0,-1,1],
[1,0,-1],
[-1,1,0]]
results = ["Hoa","Thang","Thua"]
print ("Ket qua",results[mx[computer][userinput]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment