thon-list@python.org
Subject: Re: Optimizing Small Python Code
On 24 Jun 2021, at 16:58, Avi Gross via Python-list mailto:python-list@python.org> > wrote:
Now a has a length of 53!
It now looks like this:
b'x\x9c3\xe4R\x00\x03\x03.#8\x0bB\x1br\x19c\x88(\x18q\x99p!q\xc1\x00\
> On 24 Jun 2021, at 16:58, Avi Gross via Python-list
> wrote:
>
> Now a has a length of 53!
>
> It now looks like this:
>
> b'x\x9c3\xe4R\x00\x03\x03.#8\x0bB\x1br\x19c\x88(\x18q\x99p!q\xc1\x00\xa6\xd1\x98\xcb\x14S\x03\x9a\n\x13.3\x82j
> \xb4\t\x94\x86\x99\t\x00\xdc\x87\x14\xb7'
>
> So th
t; 0
> 1
> 2
> 3
> 4
> 5
>
> Of course, the above has overhead as you have a line to import the library
> as well as the darn function names but for larger amounts of text, those
> stay fixed.
>
> I note again this won't fool h
pare the output will be fooled.
-Original Message-
From: jan
Sent: Thursday, June 24, 2021 3:01 AM
To: Avi Gross
Cc: python-list@python.org
Subject: Re: Optimizing Small Python Code
If I'm not mistaken, the original output is O(n^2) in quantity of chars, and as
output time is propo
> From: Python-list On
> Behalf Of Michael F. Stemper
> Sent: Wednesday, June 23, 2021 10:23 AM
> To: python-list@python.org
> Subject: Re: Optimizing Small Python Code
>
> On 23/06/2021 08.17, Stefan Ram wrote:
>> "Avi Gross" writes:
>>> This can be m
the string and uncompressed it, you might have code like:
print(unzip("n*n&&S!~se"))
-Original Message-
From: Python-list On
Behalf Of Michael F. Stemper
Sent: Wednesday, June 23, 2021 10:23 AM
To: python-list@python.org
Subject: Re: Optimizing Small Python Code
O
On 23/06/2021 08.17, Stefan Ram wrote:
"Avi Gross" writes:
This can be made a one-liner too! LOL!
print( '1\n 0\n2\n 0\n 1\n3\n 0\n 1\n 2\n4\n
0\n 1\n 2\n 3\n5\n 0\n 1\n 2\n 3\n
4\n6\n 0\n 1\n 2\n
Kais Ayadi wrote at 2021-6-22 08:03 -0700:
>Hi There!
>this is a small python code executed in 61 steps
>
>for n in range(1, 7):
>print (n)
>for x in range(0, n):
>print(" ", x)
>
>can this code be more optimised?
You should proceed as follows:
implement a task in the most stra
in range(1,
last)]))
Now why you want this is beyond me!
-Original Message-
From: Python-list On
Behalf Of Greg Ewing
Sent: Tuesday, June 22, 2021 7:05 PM
To: python-list@python.org
Subject: Re: Optimizing Small Python Code
On 23/06/21 3:03 am, Kais Ayadi wrote:
> for n in range(1, 7):
>
How would you measure the steps that it takes?
- Benjamin
> On Jun 22, 2021, at 7:04 PM, Greg Ewing wrote:
>
> On 23/06/21 3:03 am, Kais Ayadi wrote:
>> for n in range(1, 7):
>> print (n)
>> for x in range(0, n):
>> print(" ", x)
>> can this code be more optimised?
On 23/06/21 3:03 am, Kais Ayadi wrote:
for n in range(1, 7):
print (n)
for x in range(0, n):
print(" ", x)
can this code be more optimised?
Optimised for what? Readability? Execution speed? Code size?
Memory usage?
--
Greg
--
https://mail.python.org/mailman/listinfo/pyt
11 matches
Mail list logo