<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<In what way does your code behave incorrectly? Include ALL error messages.>
When I type in "python NumberGuess.py to the display screen and hit enter, nothing happens. I’m not sure what I’m doing wrong.
<What do you expect to happen instead?>
I am supposed to be at first told the max value that I can guess for a roll, but nothing happens.
"""This program will randomly roll a pair of dice, add the values of the roll, ask the user to guess a number, compare the user's guess to the total value, decide a winner, and inform the user who won """ from random import randint from time import sleep def get_user_guess(): user_guess = int(raw_input("guess a number: ")) return user_guess def roll_dice(number_of_sides): first_roll = randint(1, number_of_sides) second_roll = randint(1, number_of_sides) mas_val = number_of_sides * 2 print "The maximum value is: " + str(max_val) sleep(1) user_guess = get_user_guess if user_guess > max_value: print "Think before you type" return else: print "Rolling..." sleep(2) print "The first value is: %d" % first_roll sleep(1) total_roll = first_roll + second_roll print "Result..." sleep(1) if user_guess > total_roll: print "You have beat me, for now" return else: print "No mere human can beat me" return roll_dice(6)
Any help would be great!