This question already has an answer here:
- Replacements for switch statement in Python? 44 answers
in python this is my current code and i need all if, else and elif statements to be in switch statement form :
uname = input("What is your username? ")
if uname == "U1" or uname == "U2":
print (" ")
elif:
print ("Username Does Not Exist")
exit()
pword = input("What Is Your Password? ")
if pword == "password":
print("Welcome, ",uname," You Have Been Successfully Logged In.")
U1 = uname
else:
print("Password Wrong, Retry")
exit()```
Aucun commentaire:
Enregistrer un commentaire