Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. import random
  2. import os
  3.  
  4. class Roller:
  5. def roll6():
  6. print(random.randint(1,6))
  7. def rollSel():
  8. big = True
  9.  
  10. while big==True:
  11. try:
  12. os.system("cls")
  13. big=float(input("How big is this die?"))
  14. except:
  15. os.system("cls")
  16. print("Woops,", big, "isn't a number!, please type a number next time")
  17. big=True
  18. input()
  19. else:
  20. os.system("cls")
  21. print("You rolled a",random.randint(1,big),"on a",big,"sided die!")
  22. finally:
  23. choice=input("Would you like to roll another die? (y/n)")
  24. if choice=="n" or choice=="N" or choice=="no":
  25. big=False
  26. else:
  27. big=True
  28.  
  29.  
  30. #Roller.roll6()
  31. Roller.rollSel()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement