import random
def run_all():
print "Welcome"
name = get_name()
welcome(name)
guess = get_guess()
print guess
dice1 = get_dice()
dice2 = get_dice()
dice3 = get_dice()
total = dice1 + dice2 + dice3
print "Dice 1: " + str(dice1)
print "Dice 2: " + str(dice2)
print "Dice 3: " + str(dice3)
print "The dices total sum is: " + str(total)
print "Your guess was: " + guess
def get_name():
'''ask name'''
return raw_input("Hi, what's your name?")
def welcome(name):
''' welcome'''
print name + ", welcome!"
def get_guess():
return raw_input("We will throw 3 dices, what do you think the total sum will be? ")
def get_dice():
return random.randint(1,6)
run_all()
私は推測と合計の違いをプレイヤーに見せたいと思います。Python - 2つの数字(文字列)の違いを表示する方法
あなたの答えをありがとう! – Hannah
@Hannahあなたは大歓迎です。それがあなたを助けたら私の答えを正解と記してください。 :) –