This poster had a problem with his code, which was resolved in a comment string on the code.
But you used len which returns the length of the list (len stands for length), so you want to check that it's greater than zero, i.e. not empty. And '' is an empty string. An empty list would be [] – ᴋᴇʏsᴇʀ Mar 15 at 23:06
you are right. Stupid mistakes. Thanks Keysar ! – vishal Mar 15 at 23:07
Np, happy coding! – ᴋᴇʏsᴇʀ Mar 15 at 23:07
I found this while looking for unanswered questions and flagged it for closing, since it appears to be a simple mistake and both parties were done, but had the flag declined:
Problem solved in comments, simple fix, doesn't look like they'll be a proper answer, suggest closing. – schodge Mar 16 at 8:23 declined - a moderator reviewed your flag, but found no evidence to support it
Why would this flag be declined? Too soon? I thought I recall seeing other questions also being closed in cases like this where the problem is a typo / unlikely to benefit others? Any clarification on proper flagging on cases like this would be appreciated.