In run testing the RGB to Hex converter, following the complete exercise, I am receiving a syntax error message that looks like this:

```
$ python rgb2hex.py
File "rgb2hex.py", line 22
def hex_rgb():
^
SyntaxError: invalid syntax
```

Naturally I'm not expecting this, as I've ensured that the spacing is even (though I did use the tab key in favour of the spaces.)

Any ideas as to what's happening? Here's the code below:

```
def hex_rgb():
hex_val = raw_value("Enter a hexadecimal colour value: ")
if len(hex_val) != 6:
print "Invalid value."
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 "R:s% G:s% B:s%" % (red, green, blue)
```