4 ms·
which is nicer? float(len(str)) or str.len().float() Also, there's numerous ways of doing the same thing, despite that being contrary to python's ph
by fnord77 11mo ago
which is nicer?
float(len(str))
or
str.len().float()
Also, there's numerous ways of doing the same thing, despite that being contrary to python's philosophy
- hekkle 11mo agoActchooally: Python's philosophy (the zen of python) states: There should be one-- and preferably only one --obvious way to do it. So, the answer is to pick the obvious choice, which in this case will depend on the style guide of the project you are working on, and whether they prefer the lisp style syntax or the OO property of style.