Python interpreter expects spaces instead of tab characters in the file.
You can instruct nano to use spaces and indent by 4 spaces either editing /etc/nanorc or creating/adding
nano
/etc/nanorc
set tabsize 4 set tabstospaces
to $HOME/.nanorc
$HOME/.nanorc