import sys
import os
array = ['s','j','b'];
input = input('请输入')
if str(input) not in array:
print('输入错误')
sys.exit()
row = random.choice(array)
pin = ['ss','jj','bb'] #平
win = ['sj','jb','bs'] #赢
shu = ['sb','js','bj'] #输
res = input + row
if res in pin:
print('平')
elif res in win:
print('赢')
else:
print('输')
微信截图_20240121112337.png (41.92 KB, 下载次数: 0)
下载附件
执行结果
2024-1-21 11:27 上传