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!