+ 2

Why does the error related to length of list occur, when the norms for list length are the same across all languages?

https://code.sololearn.com/cyJ44jzMmINK/?ref=app

2nd Sep 2022, 3:31 AM
Sanjay Kamath
Sanjay Kamath - avatar
2 Réponses
+ 5
What error? there's a `set` of string in the code bit not a `list`. Are you sure that was the code in question? Actually, I'm not clearly understanding your question. Perhaps you can elaborate further on it?
2nd Sep 2022, 4:49 AM
Ipang
+ 4
Sanjay Kamath , there is a small typo in your set, have a look at the second 'pen' since there is an enclosed comma in the last string. ppap={"pen","pineapple","apple",",pen"} ^^^ for this case, the length will be 4. if you correct the typo, the length will be 3.
2nd Sep 2022, 6:09 PM
Lothar
Lothar - avatar