0
why am i getting an error in this progem ?
The program is: password=input("Enter your password:") print("your passowrd is"+password) if password != "hello123": print("wecome master") else: print("invalid password"+"try again") The output i got is: Enter your password:asegkh Traceback (most recent call last): File "pssword.py", line 1, in <module> password=input("Enter your password:") File "<string>", line 1, in <module> NameError: name 'asegkh' is not defined
2 Respuestas
+ 2
The code works fine for me, though at line 6 there is no need to concatenate the strings together. Additionally there might be a logic error when checking the password, if the password is hello123 then the if statement should say: if password == "hello123": instead of !=.
+ 1
i got it
i found the error,now its working
Thanks for the help dude