I don't really know if my code is right maybe you can guide me anyway, and the error I really don't understand where's my mistake.
indent everything starting from the else block 4 spaces(one tab) back.
The very last line move it out of the function
problem solve ! Thx