Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import choice ## random is a module and choice is a function
- hex_chars = ['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'] ## create the list of characters from which to choose
- colour_code = '#' ## this is the start of any colour code in python
- for i in range (0,6):
- colour_code = colour_code + choice(hex_chars)
- print ('The hexadecimal colour code generated is:' ,colour_code)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement