Drop links or images here to add them to the editor.

In a make task you write the program yourself, from an empty editor.

A bank vault system stores its daily override code in a secure text file called secret_code.txt. The file holds the code on its first line:

999

Your task

Write a program that:

The program asks the user nothing: everything it needs is in the file.

The output

One line, which is either:

Vault Unlocked

or:

Incorrect Code

Testing

The code changes every day, so your program will not always find 999 in the file. Each test puts a different secret_code.txt next to your program before it runs, and the name of each test says what that file held. Some of those files hold the right code and some do not, so both of your messages get checked.

The code is compared as a number, so a file holding 0999 unlocks the vault too, and only the first line of the file counts.

Example

With 999 in secret_code.txt:

Output:

Vault Unlocked

With 123 in secret_code.txt:

Output:

Incorrect Code

To try your program before you submit it, use the To sandbox button at the bottom of the editor. The sandbox comes with a secret_code.txt holding 999. Change the number in it to see your other message.

Help! My code doesn't work!

Make sure that you check for the following things:

  • The file name is "secret_code.txt", spelled exactly like that.
  • .readline() reads just the first line, and has its brackets.
  • .close() comes straight after the reading, before the if.
  • The line is wrapped in int() before it is compared. Without it, the line read from the file is the text "999\n", which is never equal to 999.
  • The comparison uses ==, and 999 has no quotes around it.
  • The two messages are spelled exactly as shown, capital letters included.