Ask coding questions

← Back to all posts
dont know whats wronge with my code
PURVAPATEL (0)

username = [“myusername”, “anotherusername”]
userinput = input(“Please enter your user name”)
if userinput is in username:
print(“you have passed”)
else:
print(“you have failed”)

Commentshotnewtop
ArchieMaclean (662)

When you're declaring strings in Python, you should use either " or ', not . Just replace all instances of with ".

Please mark this as the answer if it solved your problem :)