попробуйте почитать про синтаксис Python, что значат эти четыре пробела, что такое цикл и его тело, что такое if elif else
Вспомнилась цитата ван Россума:
My recommendation is to always use tabs on the Mac -- then it will
look good on the Mac and at least parse correctly everywhere.
For the same reason I recommend always using tabs on Unix as well
(thus indenting by 8 positions there), but the majority of Python
users seem to be against me.