Feb-05-2018, 02:09 AM
Only problem I see with your code. Is those nasty recursive calls.
Using loops is a better solution.
Using loops is a better solution.
import random def dice(): while True: roll_dice = input('roll ? >> ') if roll_dice in ['y', '']: print(random.choice(range(1, 7))) elif roll_dice == 'n': break else: print('invalid entry') dice()
99 percent of computer problems exists between chair and keyboard.