! 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 · ·