On 2023-03-19, Stefan Ram wrote:
> Peng Yu writes:
>>But when I try the following code, get_body() is not found. How to get
>>get_body() to work?
>
> Did you know that this post of mine here was posted to
> Usenet with a Python script I wrote?
>
> That Python script has a function to show t
On 2023-03-19, Stefan Ram wrote:
> Jon Ribbens writes:
>>(Also, I too find it annoying to have to avoid, but calling a local
>>variable 'file' is somewhat suspect since it shadows the builtin.)
>
> Thanks for your remarks, but I'm not aware
> of such a predefined name "file"!
Ah, apparently
On 2023-03-19, Greg Ewing wrote:
> On 20/03/23 7:07 am, Jon Ribbens wrote:
>> Ah, apparently it got removed in Python 3, which is a bit odd as the
>> last I heard it was added in Python 2.2 in order to achieve consistency
>> with other types.
>
> As far as I remember, the file type came into exist
> > def sum1():
> > s = 0
> > for i in range(100):
> > s += i
> > return s
> >
> > def sum2():
> > return sum(range(100))
> Here you already have the numbers you want to add.
Actually using numpy you'll be much faster in this case:
§ import numpy as np
§ d
On 2023-03-20 15:21, Edmondo Giovannozzi wrote:
> def sum1():
> s = 0
> for i in range(100):
> s += i
> return s
>
> def sum2():
> return sum(range(100))
Here you already have the numbers you want to add.
Actually using numpy you'll be much faster in thi
On 3/20/2023 11:21 AM, Edmondo Giovannozzi wrote:
def sum1():
s = 0
for i in range(100):
s += i
return s
def sum2():
return sum(range(100))
Here you already have the numbers you want to add.
Actually using numpy you'll be much faster in this case:
§ imp