You must use when writting python the TAB. Try using VSCode for writing Python and install de Python extension. If you dont have it, use this to check if your sintax is correct: Checker-Python.
From the first view I saw you dindt use correct tabulation on the while loop.
solved username and password python I keep getting this syntax error no matter what I change in it