I get an error saying ‘unexpected indent on Line 31’ I am certain they are in line.
I’ve been over this two times, and I can’t seem to find the mistake so I came here looking for help, I’ve noticed that this is an active message board so…
Here is my code, copy and pasted:
def hex_rgb(): hex_val = raw_input("HEX: ") if len(hex_val) != 6: print "Invalid value was entered" return else: hex_val = int(hex_val, 16) two_hex_digits = 2 ** 8 blue = hex_val % two_hex_digits hex_val = hex_val >> 8 green = hex_val % two_hex_digits hex_val = hex_val >> 8 red = hex_val % two_hex_digits print "%s, %s, %s" % (Red, Blue, Green)
I’m sorry that I don’t know how to upload the code in a clean format.
A link to the exercise: https://www.codecademy.com/courses/learn-python/projects/rgb-hex