Login Check
Python
25 pts
Login Check
A school website saved the name "Merhawi" and the PIN "4821" (a string). The student typed the name "merhawi" and the PIN 4821 (an integer).
Create three booleans:
exact_name— whether the typed name is exactly the saved name.same_name— whether the names match when capital letters are ignored (use.lower()on both sides).pin_ok— whether the PINs match. Convert the typed PIN withstr()before comparing.
Print them in that order. Expected output:
False True True
Checklist
- Keep the four given variables and create
exact_name: whether the typed name is exactly the saved name. - Create
same_name: whether the names match when capital letters are ignored. - Create
pin_ok: whether the PINs match after converting the typed PIN withstr(). - Print the three booleans, one per line.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
