65 865
Assignments Done
99,1%
Successfully Done
In October 2018

Answer to Question #12756 in Python for Ray

Question #12756
Python 2.7
'count' is a list.
Values...
len(count): 216
count[26]: '20'
count.index('20'): 142
count[142]: 167

I thought count.index('20') should find the value of '20' in the list and return the index of '26'. What am I missing?
Expert's answer
count.index(x) return the index in the list of the first item whose value is x. It is an error if there is no such item.
Probably, the value of the 26th element was 20, but not '20'.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions