HackerRank Python - Hex Color Code
CSS colors are defined using a hexadecimal (HEX) notation for the combination of Red, Green, and Blue color values (RGB).
- # Enter your code here. Read input from STDIN. Print output to STDOUT
-
- import re
-
- for _ in range(int(input())):
- matches = re.findall(r':?.(#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3})', input())
- if matches:
- print(*matches, sep='\n')