Created
July 29, 2017 22:56
-
-
Save AllanRPereira/79faeaa7f585ecf1dd542ba11936cbb5 to your computer and use it in GitHub Desktop.
Codimizando Segunda Etapa
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
| import random | |
| color = 7 | |
| pre_code = "\033[1;3" | |
| end_code = "\033[0m" | |
| number = int(input("{}{}mDigite um número legal! : {}".format(pre_code, random.randint(0,color), end_code))) | |
| for i in range(11): | |
| n_spaces = len(str(number * 10)) + 1 - len(str(number * i)) | |
| print("{}{}m{}{}= {} x {}{}".format(pre_code, random.randint(0, color), number * i, n_spaces * " ", i, number, end_code)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment