+ 1
can any one explain this
7 Antworten
+ 4
t = (1,2,5,4,5)
r = (3,5,6,4,4)
z = r + t
print(z) it will give output as
z=(3,5,6,4,4,1,2,5,4,5)
c=z.count(t[3])
t[3]= 4 and if u count then its repeat 3 times so 3 will be answer
+ 4
t=(1,2,5,4,5)
r=(3,5,6,4,4)
z=r+t
c=z.count(t[4])
print (c)
z = r + t which makes z = (1,2,5,4,5,3,5,6,4,4)
and the count method returns the number of times the integer *5* appeared in z since 5 is index four and it appeared 3 times
+ 3
sravani
z = addition of r and t
z = (3,5,6,4,4,1,2,5,4,5)
Now,
c = z.count(t[3])
c = z.count(4)
What z.count(4) means is count how many 4's are in z.🙂
Therefore, c = 3.
Happy Coding 😀😀
+ 2
t = (1,2,5,4,5)
r = (3,5,6,4,4)
z = r + t
print(z) # print <z> so you know what it's like
c = z.count(t[3]) # t[3] is 4, so <c> is count of 4 in <z>
print(c)
(Edited)
+ 1
No, t[3] is 4, and t[4] is 5.
0
i get t[4] is 3
how it is possible
0
tq😊