Question: Create a Python script that will check if a file crypto.txt exists. If it does not exists, ask the user to enter a password, create

Create a Python script that will check if a file crypto.txt exists. If it does not exists, ask the user to enter a password, create the file and store the password in the file. If the file does exist, then ask the user for a password and test if the password given and the password that is in the file match. The only import (except for any basic Python packages) you are allowed to make is for os. Ensure that if any errors occur, an error message will be printed to the console window and that the file will always be closed; even if an error occurs, i.e. the file should always be closed after processing, no matter what happens. As your answer, paste all of your Python code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
