Re: how to exit from a nested loop in python

2019-02-09 Thread DL Neil
On 8/02/19 7:45 PM, Kaka wrote: for i in range(len(A.hp)): for j in range(len(run_parameters.bits_Mod)): req_slots[j] = math.ceil((A.T[i]) for g in Temp[i]["Available_ranges"][j]: for s in range(g[0], g[-1]): if (s+req_slots[j]-1) <= g[-1]

Re: Loop with else clause

2019-02-09 Thread DL Neil
Possibly the final contribution:- On 9/02/19 1:30 AM, Adriaan Renting wrote: Wow, you dug deep. =Thank you. It started to 'bug' me, so I really was 'scratching an itch'! My example was the reverse of the "toy example"'s you mention as I find that often code becomes much clearer if you ord

Re: My appreciation for python's great work to my country.

2019-02-09 Thread Terry Reedy
On 2/8/2019 4:37 AM, Kiyimba Godfrey wrote: I take this opportunity to thank python for having designed such a wonderful program which has enabled computer scientists and programmers in my country Uganda, understand, design and create other computer application programs . You're welcome, and

Re: The slash "/" as used in the documentation

2019-02-09 Thread Terry Reedy
On 2/9/2019 2:10 PM, Piet van Oostrum wrote: Christian Gollwitzer writes: __import__( 'sys' ).version '3.6.1 |Anaconda 4.4.0 (x86_64)| (default, May 11 2017, 13:04:09) \n[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]' help( __import__( 'math' ).sin ) Help on built-in function sin

My appreciation for python's great work to my country.

2019-02-09 Thread Kiyimba Godfrey
I take this opportunity to thank python for having designed such a wonderful program which has enabled computer scientists and programmers in my country Uganda, understand, design and create other computer application programs . Yours, Lubega Tom Sent from Mail

Re: The sum of ten numbers inserted from the user

2019-02-09 Thread Terry Reedy
On 2/9/2019 4:23 AM, Christian Gollwitzer wrote: Am 08.02.19 um 09:58 schrieb ^Bart: A colleague did: total=0 for n in range(10): n= int(input("Enter a number: ")) Here, you are reusing "n" for two different things: 1. The loop index, indicating which number you ask for 2. The number en

Re: The slash "/" as used in the documentation

2019-02-09 Thread Piet van Oostrum
Christian Gollwitzer writes: __import__( 'sys' ).version > '3.6.1 |Anaconda 4.4.0 (x86_64)| (default, May 11 2017, 13:04:09) \n[GCC > 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]' help( __import__( 'math' ).sin ) > > > Help on built-in function sin in module math: > > sin(...) >

Re: The slash "/" as used in the documentation

2019-02-09 Thread Terry Reedy
On 2/9/2019 8:29 AM, Piet van Oostrum wrote: r...@zedat.fu-berlin.de (Stefan Ram) writes: The slash »/« as used in the documentation f( x, /, y ) is so ugly, it will disappear. Especially since it consumes a comma as it it was a parameter itself. Possible alternatives include:

Re: The slash "/" as used in the documentation

2019-02-09 Thread Christian Gollwitzer
Am 09.02.19 um 14:40 schrieb Stefan Ram: Piet van Oostrum writes: r...@zedat.fu-berlin.de (Stefan Ram) writes: The slash »/« as used in the documentation f( x, /, y ) What are you talking about? What documentation? It seems to me you are talking about a completely different programming langua

Re: The slash "/" as used in the documentation

2019-02-09 Thread Piet van Oostrum
r...@zedat.fu-berlin.de (Stefan Ram) writes: > The slash »/« as used in the documentation > > f( x, /, y ) > > is so ugly, it will disappear. Especially since it consumes > a comma as it it was a parameter itself. > > Possible alternatives include: > > A newline: > > f( x, > y ) > > A

Re: The sum of ten numbers inserted from the user

2019-02-09 Thread Christian Gollwitzer
Am 08.02.19 um 09:58 schrieb ^Bart: A colleague did: total=0 for n in range(10):     n= int(input("Enter a number: ")) Here, you are reusing "n" for two different things: 1. The loop index, indicating which number you ask for 2. The number entered from the user This is avery bad thing.