TLDR; How do you figure out if code is inefficient (if it isn't necessarily
obvious) and how do you find a more efficient solution?
I use code wars sometimes to get some practice with Python, there was a
challenge to compare two strings and if string1 had enough characters to be
rearranged to make
Sorry my first email didn't have a subject line
TLDR; How do you figure out if code is inefficient (if it isn't necessarily
obvious) and how do you find a more efficient solution?
I use code wars sometimes to get some practice with Python, there was a
challenge to compare two strings and if strin
On 10/19/2018 10:12 AM, Pat Martin wrote:
> Sorry my first email didn't have a subject line
>
> TLDR; How do you figure out if code is inefficient (if it isn't necessarily
> obvious) and how do you find a more efficient solution?
I think you've hit it in your last sentence ("except maybe write mo
Pat Martin wrote:
> Sorry my first email didn't have a subject line
>
> TLDR; How do you figure out if code is inefficient (if it isn't
> necessarily obvious) and how do you find a more efficient solution?
>
> I use code wars sometimes to get some practice with Python, there was a
> challenge to
Mats Wichmann wrote:
> On 10/19/2018 10:12 AM, Pat Martin wrote:
>> Sorry my first email didn't have a subject line
>>
>> TLDR; How do you figure out if code is inefficient (if it isn't
>> necessarily obvious) and how do you find a more efficient solution?
>
> I think you've hit it in your last
That's correct sorry, I reassigned with replace back to string2, I forgot
that in my retyping of the snippet.
That makes sense, when it comes to strings and it taking so long. Thanks
for explaining that.
On Fri, Oct 19, 2018 at 10:09 AM Peter Otten <__pete...@web.de> wrote:
> Mats Wichmann wrote
So should we always use sets or dictionaries if possible? Are these more
efficient because of not keeping track of their position?
On Fri, Oct 19, 2018 at 10:47 AM Pat Martin wrote:
> That's correct sorry, I reassigned with replace back to string2, I forgot
> that in my retyping of the snippet.
Pat Martin wrote:
> So should we always use sets or dictionaries if possible? Are these more
> efficient because of not keeping track of their position?
Not always. If you want to know how often one entry/char occurs in a linear
storage like a list, a string, or a file, then you can loop over th
On 19 Oct 2018 18:09, Pat Martin wrote:
TLDR; How do you figure out if code is inefficient (if it isn't necessarily
obvious) and how do you find a more efficient
-
Hi, check this: https://docs.python.org/3/library/profile.html. Also, the
timeit module is handy for smaller snippets.
_
On 19/10/18 17:12, Pat Martin wrote:
> TLDR; How do you figure out if code is inefficient (if it isn't necessarily
> obvious) and how do you find a more efficient solution?
Others have addressed most of the issues but I'd just add the caveat
that you can spend forever trying to make your code "mo
On 19Oct2018 23:07, Alan Gauld wrote:
On 19/10/18 17:12, Pat Martin wrote:
TLDR; How do you figure out if code is inefficient (if it isn't
necessarily obvious) and how do you find a more efficient solution?
Others have addressed most of the issues but I'd just add the caveat
that you can spen
On Fri, Oct 19, 2018 at 09:12:54AM -0700, Pat Martin wrote:
> Sorry my first email didn't have a subject line
>
> TLDR; How do you figure out if code is inefficient (if it isn't necessarily
> obvious) and how do you find a more efficient solution?
You know it is inefficient if it takes longer to
12 matches
Mail list logo