Keep getting error: Wrong Answer. Your program's output doesn't match the expected output


#1

That is my code. I keep getting error:
Wrong Answer. Your program’s output doesn’t match the expected output. You can try testing your code with custom input and try putting debug statements in your code.

def main():
S = input()
#Your code goes here
print(S.isalnum())
print(S.isalpha())
print(S.isdigit())
print(S.islower())
print(S.isupper())

return 0

if name == ‘main’:
main()

What am I missing?


#2

The question says “has ANY alphanumeric (etc) characters”. And the functions are to validate the entire string at once. “ALL characters are alphanumeric”.


#3

I too have faced the same issue tonight while solving this question. I have tried fixing it, but it just shown me Wrong Answer when tested. I was confident in my approach, and thus I decided to submit it anyway. Guess what, I had an ‘Accepted’ result with a Green Tick Mark.

So, do look for what’s required in the problem, and go ahead and submit the code anyway. You should get AC.

The error in trivial case validation could be due to the boolean output comparison with a string one, but I’m not entirely sure about the issue since it’s hidden.


#4
def main():
s = input()
#Your code goes here
print(any(i.isalnum() for i in s))
print(any(i.isalpha() for i in s))
print(any(i.isdigit() for i in s))
print(any(i.islower() for i in s))
print(any(i.isupper() for i in s))


return 0

if name == ‘main’:
main()