it's a limitation of SoloLearn playground. the issue is the while loop, playground is not a real terminal, your code gets executed on SoloLearn servers and returns the output it does not wait for the while loop to finish in this context. remove this part and keep the function check_password() only. password_trials = 1 while password_trials <= 3: try: check_password() except IndexError: print('password can\'t be blank') password_trials += 1
It works that way though I wanted it to recur.Thanks.