Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I need help with this code
! marks are driving me crazy because they do not make sense to me.
this is a simple code provided by a tutorial book i found, can someone explain it to me?
while password != "unicorn":
password = input("Password: ")
according to this, the password would be unicorn, however, doesnt the exclamation point before the equal sign make password not equal to unicorn? This confuses the hell out of me
As a matter of fact this book gives projects, and some possible answers to the project, but doesnt really explain it.
If someone could break this down for me i would appreciate it
name = input("What is your UserName: ")
password = input("What is your Password: ")
print("To lock your computer type lock.")
command = None
input1 = None
input2 = None
while command != "lock":
command = input("What is your command: ")
while input1 != name:
input1 = input("What is your username: ")
while input2 != password:
input2 = input("What is your password: ")
print("Welcome back to your system!")
What does None mean?
and also what are the exclamations doing.
Why is command even there?
0 · ·