Description has been redone.
Look ma, no imports!
That :g float presentation type in f-strings is genius! Now that I know, I won't forget it!
Gotta love that asterisk operator unpacking to an empty list when the len of bands is 3!
Super clean and readable!
I hated this one.
I like that textwrap module!
Self-explanatory, yet concise... a real gem!
Lean and mean!
Worst practice but clever! :-D
'match' is a soft keyword since Python version 3.10 (see https://docs.python.org/3/reference/lexical_analysis.html#keywords), therefore I wouldn't use it as a variable name now.
No need to reinvent the wheel! :)
If you swap out exec with print, you'll see what is what is passed to the exec function.
As a non native English speaker, I agree with @blopezpi. And after looking at the docstrings of some of the solutions, others felt the need to clarify what this method does.
You might be using the wrong string method on the wrong string. Hopefully I've said enough but not too much.
Loading collection data...
Description has been redone.
Look ma, no imports!
That :g float presentation type in f-strings is genius! Now that I know, I won't forget it!
Gotta love that asterisk operator unpacking to an empty list when the len of bands is 3!
Super clean and readable!
I hated this one.
I like that textwrap module!
Self-explanatory, yet concise... a real gem!
Lean and mean!
Worst practice but clever! :-D
'match' is a soft keyword since Python version 3.10 (see https://docs.python.org/3/reference/lexical_analysis.html#keywords), therefore I wouldn't use it as a variable name now.
No need to reinvent the wheel! :)
If you swap out exec with print, you'll see what is what is passed to the exec function.
As a non native English speaker, I agree with @blopezpi. And after looking at the docstrings of some of the solutions, others felt the need to clarify what this method does.
You might be using the wrong string method on the wrong string.
Hopefully I've said enough but not too much.
Loading more items...