0

Hi guys. Can somebody explain this code, and why the answer is 7?

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

7th Mar 2020, 8:20 PM
Pavlo Omelianchuk
Pavlo Omelianchuk - avatar
2 ответов
+ 3
the result of list(map(str,x)) is a list that contains two strings = ['[0]', '[1]'] 'a'.join(list(map(str,x))) joins strings '[0]' and '[1]' together using string 'a' as separator = '[0]a[1]' len('a'.join(list(map(str,x)))) returns the length of the string '[0]a[1]' which is 7
7th Mar 2020, 8:35 PM
andriy kan
andriy kan - avatar
0
Thanks!
7th Mar 2020, 10:01 PM
Pavlo Omelianchuk
Pavlo Omelianchuk - avatar