+ 2
x=2 y=3 z=[3,8,5] print(len(x*y*z))
Why the output is 18 ??
4 ответов
+ 9
Imtiaz Supto as now you have updated the X value so x × y is number not an list elements so it will return 6 as multiplication then 6 is multiply with list Z 3 elements which result in print the list with 3 element 6 so it will give 18 elements so the length of Z list will become 18 so this way output is comes as 18
printing Z will return [1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3] which is length in 18
+ 5
Imtiaz Supto output is 0 as x value is 0 how you come up with 18 ?
+ 1
Oh sorry.... Yes the output is 0 but how...??
now it's 18
+ 1
Oh really thanks....!! I understand it properly....!!!! 😊😇