2 Respostas
+ 6
Bro when we calculate the length of a char or list , we count from zero
For example :
List=[0,1,2,3,4,5]
len(list)
Output
6
str="Hii"
len(str) == 3
Str="hello"
len(Str)==5
Thanks
0
indexes in ordered iterables are always counted from 0.
lengths of any iterables are always counted from 1.