Hi. I have got the correct code and I can’t see anything wrong with it but when I type the file in for the freeform project, nothing happens.
Happy to provide photos of code and errors.
Here’s the code:
"""This is a number guessing game the idea is that the player/you will guess a number, and the program will decide who the winner is, if the player/you guess is BIGGER than the dice rolled result, then the player/you wins. Otherwise the computer wins""" from random import randint from time import sleep def get_user_guess(): user_guess = int(raw_input ("Please input your guess, it's two dice!: ")) return user_guess def roll_die(number_of_sides): roll_dice(6) first_roll = randint(1, number_of_sides) second_roll = randint(1, number_of_sides) max_val = number_of_sides * 2 print "The max value that can be a roll: " + str(max_val) sleep (1) user_guess = get_user_guess() if user_guess > max_val: print "Your guess is too big, it's six sides after all!" return else: print "Rolling..." sleep (2) print "The first roll is resulting too: %d" % first_roll sleep (1) print "The second roll is resulting too: %d" % second_roll total_roll = first_roll + second_roll print "The total roll is resulting too: %d" % total_roll if user_guess > total_roll: print "You win!" return else: print "You lost!" return