On 2020-05-22, DL Neil via Python-list wrote:
> On 23/05/20 4:31 AM, Grant Edwards wrote:
>> On 2020-05-22, Peter Otten <__pete...@web.de> wrote:
>>
>>> If you want to terminate the script you can use exit. However exit
>>> is a function, and you have to call it
>>>
>>> exit()
>>
>>
>>
>> Actu
On 5/22/2020 12:31 PM, Grant Edwards wrote:
On 2020-05-22, Peter Otten <__pete...@web.de> wrote:
If you want to terminate the script you can use exit. However exit
is a function, and you have to call it
exit()
Actually it's an instance of _sitebuiltins.Quitter not a function.
Which means
On 23/05/20 4:31 AM, Grant Edwards wrote:
On 2020-05-22, Peter Otten <__pete...@web.de> wrote:
If you want to terminate the script you can use exit. However exit
is a function, and you have to call it
exit()
Actually it's an instance of _sitebuiltins.Quitter not a function.
You still have
On 2020-05-22, Peter Otten <__pete...@web.de> wrote:
> If you want to terminate the script you can use exit. However exit
> is a function, and you have to call it
>
> exit()
Actually it's an instance of _sitebuiltins.Quitter not a function.
You still have to call it. ;)
--
Grant
--
https:
On 2020-05-22 7:49 a.m., John Yeadon via Python-list wrote:
> Am I unreasonable in expecting this code to exit when required?
Yes.
> # Add up the powers of 2 starting with 2**0 until 2 million is met.
> n = 1
> target = 200
> sum = 0
>
> while True:
> x = 2 ** (n - 1)
> sum += x
>
On Friday, May 22, 2020, at 7:49, John Yeadon via Python-list wrote:
> Am I unreasonable in expecting this code to exit when required?
Yes. :-)
> # Add up the powers of 2 starting with 2**0 until 2 million is met.
> n = 1
> target = 200
> sum = 0
>
> while True:
> x = 2 ** (n - 1)
>
John Yeadon via Python-list wrote:
> Am I unreasonable in expecting this code to exit when required?
It is unreasonable to expect something that doesn't match what you read in
the tutorial ;)
If you want to terminate the script you can use exit. However exit is a
function, and you have to call
No not really. If you use a breakpoint and a debugger you will find out
that your code continues till 2 M is met and then stops printing numbers
continuously.
On Fri, 22 May, 2020, 5:20 pm John Yeadon via Python-list, <
python-list@python.org> wrote:
> Am I unreasonable in expecting this code to
On Fri, May 22, 2020 at 7:51 AM John Yeadon via Python-list
wrote:
>
> Am I unreasonable in expecting this code to exit when required?
>
>
> # Add up the powers of 2 starting with 2**0 until 2 million is met.
> n = 1
> target = 200
> sum = 0
>
> while True:
> x = 2 ** (n - 1)
> sum +