samedi 26 octobre 2019

Making this if statement converted to a switch statement work in python [duplicate]

This question already has an answer here:

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