This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from random import choice, randint | |
| from termcolor import colored # must be pip installed | |
| def do_roll(): | |
| roll = randint(1,6) | |
| if roll < 5: | |
| colors = ['red', 'green', 'blue', 'yellow'] | |
| selected_color = choice(colors) | |
| print colored("{} {}".format(roll, selected_color), selected_color) |