RT例如random.randint(1,3)1=好,2=不好,3=随便然后随机数字为2的时候直接print出"不好"???求高手!!!!!还有whileuser1:user=input("Pleaseenter1forrock,2forpaper,3forscissorsor-1fo...
RT
例如
random.randint(1,3)
1 = 好, 2 = 不好, 3 = 随便
然后随机数字为2 的时候
直接print 出 "不好"
???
求高手!!!!!
还有
while user1 :
user = input("Please enter 1 for rock, 2 for paper, 3 for scissors or -1 for quit: ")
computerChoice = random.randint(1,3)
if user == -1:
print "Goodbye"
user1 = False
if user == 1:
print "You chose rock"
if user == 2:
print "You chose paper"
if user == 3:
print "You chose scissors"
if computerChoice == 1:
print "The computer chose rock"
if computerChoice == 2:
print "The computer chose paper"
if computerChoice == 3:
print "The computer chose scissors"
如何 在结束的时候 不在打印 computerChoice?
The Rock Paper Scissors Game
Please enter 1 for rock, 2 for paper, 3 for scissors or -1 for quit: -1
Goodbye
The computer chose scissors<======不要这行!!
展开