Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. import random, sys
  2.  
  3. yes = 'y'
  4. no = 'n'
  5.  
  6. print 'Hello, welcome to a simple dice simulator I made to test out Sublime Text Editor'
  7. option = raw_input('Would you like to roll a die? Y/N \n')
  8. if option == yes:
  9.     diceroll = random.randint(1,6)
  10.     print 'The die rolled: ' +str(diceroll)
  11.     raw_input = ()
  12.     sys.exit(0)
  13. elif option == no :
  14.     raw_input = ('Press any key to close this program')
  15.     sys.exit(0)
  16. else:
  17.     print 'Sorry that is not a valid entry'
  18.     raw_input = ()
  19.     sys.exit(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement