Skip to content

Instantly share code, notes, and snippets.

@AllanRPereira
Created July 29, 2017 22:56
Show Gist options
  • Save AllanRPereira/79faeaa7f585ecf1dd542ba11936cbb5 to your computer and use it in GitHub Desktop.
Save AllanRPereira/79faeaa7f585ecf1dd542ba11936cbb5 to your computer and use it in GitHub Desktop.
Codimizando Segunda Etapa
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