Metal Detector - Python

Hi, please could you format your code so we can see the indents. Topic with instructions here: How to Post Your Code With Radiant, Harmonious Formatting.
Thanks
Danny