3 ms·
> String length in Python is maybe too much exaggeration unless someone hasn’t wrote Python for a long time. Or they use several languages. Say you have client
by tzs 7y ago
> String length in Python is maybe too much exaggeration unless someone hasn’t wrote Python for a long time.
Or they use several languages. Say you have client side code in JavaScript, with the client served by PHP on the server. You've got some log analysis scripts in Perl. You've got some SOAP services in Java. You've got some machine learning stuff in Python. You've got a mobile app in Swift.
It's real easy to get confused about which of foo.length, strlen($foo), length($foo), foo.length(), len(foo), or foo.characters.count is the right one for the language you are dealing with at the moment.