Ask coding questions

← Back to all posts
dont know whats wronge with my code

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

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 :)