python - Difference between Len and Print Len() -


i've started doing data analysis in python , since didn't learn python scratch feel i've missed few nuances.

one thing noticed in 1 of reports had imported data set csv, put in dictionary, manipulated , trying print remaining entries.

i used:

len(a) len(b) len(c) 

when did 1 of numbers returning , spent significant amount of time debugging code. in end found similar code online , tried copy syntax. change worked was:

print len(a) print len(b) print len(c) 

i'm trying understand difference between 2 commands. initial thought len printed out count, guess different?

does len have 'memory' 1 count? why need add print?

len(list) not print anything, returns. if using repl (read - evaluate - print - loop) print returned value , loop. therefore print more 1 must call print.

here method documentation


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo