0
Can someone explain how is this length calculated
Something similar came up in one of the challenges, so I tried to play with it hoping Iād figure it out but I still donāt have a good understanding so reaching it to community for help X= [[0],[1]] print(list(map(str, x))) print(āā.join(list(map(str, x)))) print(len(āā.join(list(map(str,x))))) I understand the output of first and second line: >>[ā[0]ā, ā[1]ā] >>[0][1] >>6 But donāt understand how the last line (length of )6 is calculated. Iād appreciate a simple explanation.
2 Answers
+ 1
handled as string? 6 characters, [ ] included.
first one makes items in list strings, second joins contents of lists as a single string and the third counts its lenght in characters
0
Thank you! That makes sense now!