Python NumberGuess:控制台卡住了

时间:2018-08-02 09:27:34

标签: python python-3.x python-2.7

我已经写了以下代码,当我在提示符下启动程序时,它什么也没发生。为什么?

这是我的代码:

from random import randint
from time import sleep

def get_user_guess() :
  guess = int(input("Guess the dice number: "))
  return guess

def roll_dice(number_of_sides):
  first_roll = randint (1, number_of_sides)
  second_roll = randint (1, number_of_sides)
  max_val = number_of_sides * 2
  print ("The maximum possible value is {:d}" .format(max_val))
  guess = get_user_guess()
  if guess > max_val:
    print ("result is invalid !")
roll_dice(6)

0 个答案:

没有答案