This was an exercise made while participating of a Python masterclass.
If you use Pycharm, maybe the script is not going to work because of getpass.
Here has some ways to make work getpass on Pycharm: StackOverflow
Or you can also change getpass for input, but it's not safe.