Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created December 12, 2018 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/546e2ca3356a4deb49f95f08825f3d58 to your computer and use it in GitHub Desktop.
Save codecademydev/546e2ca3356a4deb49f95f08825f3d58 to your computer and use it in GitHub Desktop.
Codecademy export
"""
This is a project
That I am writing
python NumberGuess.py
"""
from random import randint
from time import sleep
def get_user_guess():
guess = int(raw_input("Enter Guess:"))
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 value possible is: %d" % max_val
guess = get_user_guess()
if guess > max_val:
print '%d is to large, please select again' %guess
roll_dice(6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment