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).



  1. # Enter your code here. Read input from STDIN. Print output to STDOUT
  2. import re
  3. for _ in range(int(input())):
  4. matches = re.findall(r':?.(#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3})', input())
  5. if matches:
  6. print(*matches, sep='\n')




codesadda.com

Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube