Firstly try and run this as a script in IDLE or pyscripter or something.
You have the indentation wrong. The line starting else:
Should be at the same level as the if:
Indentation in python is a crucial part of the language syntax.
Try doing a bit of reading up on python first.