Study Notes
- Today, I learned two related statements: if, else, elif, and, and.
- elif follows the if statement in the judgment.
- and is used when multiple conditions must be met for the statement to be true.
- Indentation is crucial!
CODE
print("MY LOGIN SYSTEM")
print("+++++++++++++++")
varname=input("Username > ")
varpasswd=input("Password > ")
if varname=="David" and varpasswd=="toallyNotBald":
print("Hey David")
elif varname=="lily" and varpasswd=="toallyNotBald":
print("Hey Lily")
elif varname=="Jo" and varpasswd=="toallyNotBald":
print("Hey Jo")
else:
print("Go Away")