+ 2
Access deny problem
https://sololearn.com/compiler-playground/cB926gxh4s70/?ref=app When I type username and password with a space in the end it causing Access Deny can't we make it flexible? So that the interpreter ignores the spaces
3 Answers
+ 5
FREEZO a simple solution could be as
if username == "apple" or username == "apple " and password == "knife" or password == "knife ":
In the above example there is the correct value or value with a whitespace
another option is using .rstrip()
username = username.rstrip()
password = password.rstrip()
.rstrip(): Removes trailing characters (whitespace by default) from the right side of the string.
+ 4
BroFar thank you it works! :)
+ 4
You're welcome