Python教你用20行代码做一个骰子模拟博弈游戏
废话不多说,直接开源码
import random
money=100
d=False
while d=False:
a=random.randint(1,6)
b=input('请输入您的博弈数字')
c=input('请输入您要下注的金额')
if a=b:
money+(c*2)
print('您现在有的金额为:'+money+'$')
else:
money-c
print('您现在有的金额为:'+'money'+'$')
if money<=0:
print('您已成为输家,请离开赌场')
d=True
if money=>100000000:
print('您已成为赢家,祝贺您下次再来')
d=True
制作不易,请多多关注