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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!