# -*- coding: utf-8 -*- """ Created on Tue Sep 29 16:00:48 2020 @author: miahsu 06.骰寶 隨機練習 """ import random print("遊戲開始") money=1000 a = random.randint(1,6) b = random.randint(1,6) c = random.randint(1,6) rand=a+b+c guess=int(input("輸入1買大,輸入0買小,請輸入猜的數字:")) if guess==1 or guess==0: print("本金為:",money) give=int(input("請輸入下注金額:")) if give<=money and give >0: if rand>=11 and guess==1: money=money+give print ("猜中了,點數是",rand,"你的本金為",money) elif rand<11 and give==0: money=money+give print ("猜中了,點數是",rand,"你的本金為",money) else: money=money-give print ("猜錯了,點數是",rand,"你的本金為",money) else: print("下注金額錯誤") else: print("輸入錯誤")