Number Guess : Not responding to an entered number


The last step tells me to enter python, and it works. But when I enter a number, nothing happens. Apparently, it has to prompt a question, but nothing happens.

from random import randint
from time import sleep

def get_user_guess():
  user_guess = int(raw_input("What's your guess, player?"))
  return user_guess
def roll_dice(number_of_sides):
  first_roll = radint(1, number_of_sides)
  second_roll = radint(1, number_of_sides)
  max_val = number_of_sdes * 2
  print "The grand maximum value is . . . *drum roll* " + str(max_val)
  user_guess = get_user_guess()
  if user_guess > max_val:
    print "I'm sorry, but you have overmaximumgitus. You can only cure yourself by making your number choice below the maximum value. Please, save yourself!"
    print "Dice rolling in the deep~"
    print "The first value enters from the cave of a monster's mouths from the depths of its belly: %d" % first_roll
    print "The second value comes from under the ocean from a living breathing underwater volcano.: %d" % first_roll
    total_roll = first_roll + second_roll
    print "The total is. . . da dum dum . . ."
  if user_guess > total_roll:
      print "You won a hundred adorable martians to command! Oh, the possibilities!"
      print "You have lost. The grave beckons you, but you can still rise from the dead."

PS: Is there a way for the statements to be randomly generated as well and I could add more to it?


the function call (last line) should be outside/after the function, given the call executes the function.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.