This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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