Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write in PYTHON. I was able to start by getting the owner and keys from the command line validate the key versus the key
Please write in PYTHON.
I was able to start by getting the owner and keys from the command line
validate the key versus the key set by owner in the beginning. (key must equal key_1 or key_2 or... key_n)
Only users with an authorized key can enter the house. To enter the house, the user must first put their key in the lock, then turn the lock, then enter the house, only if the key is valid. A house can be rekeyed with new keys only by the owner, and only if the owner is inside the house. Firefighters can enter with the secret key (literal string) FIREFIGHTER_SECRET_KEY. The lock will always be accessed in the following way: insert key, turn the lock, then enter the house it is not guaranteed that it is the same user, however). Other commands can be issued in between insert, turn, and enter, however they do not affect the lock state. Testing if a key is valid is done when the lock is turned. INSERT KEY Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started