Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 17 Online
OpenStudy (anonymous):

Hi, I want to know how to find out the number of elements in a list. Is there a attribute to lists or tuples which determine the number of elements in a list or tuple? Thanks

OpenStudy (anonymous):

This is regarding problem 3 in Problem Set 3. I am thinking of implementing two for loops which check key1 against all possible key2 values returned from the exactMatch function. since the exactMatch function returns a list, I want to find out the number of values or the length of the list.

OpenStudy (anonymous):

NVM I found it, its the len() attribute lol.

OpenStudy (anonymous):

for clarity sake len() is a function not an attribute

OpenStudy (anonymous):

yes, you are right, of course. Thanks for making that distinction.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!