[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-07-04 Thread Terry J. Reedy
. The Options menu separator line separates the global settings dialog from current-window-only options, with room for more. AFAIK, both work on macOS. I would like to follow the pattern with 'Show/Hide Line Numbers', with 'off' the default for new windows. We might put it above 'Show/Hide Code

[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-07-04 Thread Tal Einat
Tal Einat added the comment: > Looks like a black belt always on the left side, this makes me feel a bit > oppressive. This currently uses the same colors as the code-context panes, which is configurable as the "context" fg/bg colors. We might find a better name for this, or even add a

[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-07-04 Thread Tal Einat
Tal Einat added the comment: Ned, thanks for taking a look! If it is decided to go forward with this then I will make sure to make the menu item state consistent with that of each window. -- ___ Python tracker

[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-07-03 Thread Ma Lin
Ma Lin added the comment: I tried PR 14030 today. By default, the fgcolor is black. Looks like a black belt always on the left side, this makes me feel a bit oppressive. Of course, the fgcolor can be changed. -- nosy: +Ma Lin Added file: https://bugs.python.org/file48455/1.png

[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-07-03 Thread Ned Deily
Ned Deily added the comment: Tal, I took a quick look at the results with the current PR and, as someone who doesn't use IDLE other than to smoke test, It looks fine to me. The concerns I raised previously about the interaction between changing the state of Options->Line Numb

[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-07-03 Thread Tal Einat
Tal Einat added the comment: I'm rather surprised at the lack of enthusiasm for this here and on idle-dev! I was sure people would be happy to see this finally approaching completion after so many years. To clarify, all I'm waiting for now is to hear whether this change is wanted, before I

[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-06-12 Thread Tal Einat
Change by Tal Einat : -- versions: +Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-06-12 Thread Tal Einat
Tal Einat added the comment: In reference to previous discussion here about the effect of toggling line numbers on future opened windows: IMO toggling shouldn't affect future windows; those should behave according to the configured default state. The default state should be changed only

[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-06-12 Thread Tal Einat
Tal Einat added the comment: Please see updated PR, GH-14030. It's not 100% ready yet. At this point the goal is to have some people try it and give feedback. So please, give it a go and let me know what you think! -- nosy: +taleinat ___ Python

[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.

2019-06-12 Thread Tal Einat
Change by Tal Einat : -- pull_requests: +13894 stage: commit review -> patch review pull_request: https://github.com/python/cpython/pull/14030 ___ Python tracker ___

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2019-06-03 Thread Mark Dickinson
Change by Mark Dickinson : -- pull_requests: +13659 pull_request: https://github.com/python/cpython/pull/13740 ___ Python tracker ___

[issue36843] AIX build fails with failure to get random numbers

2019-05-27 Thread STINNER Victor
STINNER Victor added the comment: I close the issue. Maybe contact Michael Felt to get help to debug your issue. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue32893] ast.literal_eval() shouldn't accept booleans as numbers in AST

2019-05-13 Thread Chris Angelico
Change by Chris Angelico : -- pull_requests: +13196 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36843] AIX build fails with failure to get random numbers

2019-05-10 Thread STINNER Victor
STINNER Victor added the comment: > open O_RDONLY failed Ah. That sounds like an issue on your machine or specific to AIX. I don't see what Python can do to support a platform where /dev/urandom doesn't work. Python really needs /dev/urandom at startup to initialize its "hash secret" to

[issue33329] sigaddset() can fail on some signal numbers

2019-05-10 Thread Ned Deily
Change by Ned Deily : -- Removed message: https://bugs.python.org/msg342090 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue33329] sigaddset() can fail on some signal numbers

2019-05-10 Thread Ned Deily
Ned Deily added the comment: New changeset 2226139aa2b69047cb54dbcfd79f5c2e36f98653 by larryhastings (Cheryl Sabella) in branch '3.4': [3.4] bpo-33329: Fix multiprocessing regression on newer glibcs (GH-6575) (#12145)

[issue36843] AIX build fails with failure to get random numbers

2019-05-10 Thread Robert Boehne
Robert Boehne added the comment: I wonder if there's anyone with AIX 7 who can attempt to reproduce this. We have another AIX machine, but it is down for the moment. I would like to eliminate a problem on this machine as the cause. -- ___

[issue36843] AIX build fails with failure to get random numbers

2019-05-10 Thread Robert Boehne
Robert Boehne added the comment: It doesn't look good: robb@nepal:/raid/checkouts-raid/robb/nepal$ xlc_r -q64 -O0 -g -qlanglvl=extc1x -o urandom urandom.c robb@nepal:/raid/checkouts-raid/robb/nepal$ ./urandom open O_RDONLY failed open O_RDONLY | O_CLOEXEC failed

[issue36843] AIX build fails with failure to get random numbers

2019-05-09 Thread STINNER Victor
STINNER Victor added the comment: Robert Boehne: pyurandom() uses _Py_open_noraise("/dev/urandom", O_RDONLY) which uses O_CLOEXEC if available. If this flag available? Does it work? Please try to build attached urandom.c. Example on my Fedora 29: open O_RDONLY succeeded read(16) -> 16 open

[issue36843] AIX build fails with failure to get random numbers

2019-05-08 Thread Robert Boehne
Robert Boehne added the comment: Reading a few bytes from /dev/urandom via dd: robb@nepal:/raid/checkouts-raid/robb/nepal/build-py37$ dd if=/dev/urandom bs=256 count=1 ??S?(#L???~]?B?^??8?f&?_|Vi??@??[joG>St??;?$?1?*??24???RD?"4`??aҼ#???f??? ?}

[issue36843] AIX build fails with failure to get random numbers

2019-05-08 Thread Robert Boehne
Robert Boehne added the comment: The call to open("/dev/urandom", flags) is returning -1, and errno is set to 22, EINVAL - Invalid argument. could the flags be set incorrectly? -- ___ Python tracker

[issue36843] AIX build fails with failure to get random numbers

2019-05-08 Thread Robert Boehne
h.c" ($t1) 611 if (res < 0) { (dbx) step stopped in unnamed block in _Py_HashRandomization_Init at line 612 in file "/raid/checkouts-raid/robb/nepal/build-py37/../../Python-3.7.3/Python/bootstrap_hash.c" ($t1) 612 return _Py_INIT_USER_ERR("failed

[issue36843] AIX build fails with failure to get random numbers

2019-05-08 Thread STINNER Victor
STINNER Victor added the comment: Ok, so Python uses /dev/urandom. Can you try to read a few bytes from it? Like 256 bytes. You can try my dd command. -- ___ Python tracker

[issue36843] AIX build fails with failure to get random numbers

2019-05-08 Thread Robert Boehne
Robert Boehne added the comment: from pyconfig.h: /* Define to 1 if the getrandom() function is available */ /* #undef HAVE_GETRANDOM */ /* Define to 1 if the Linux getrandom() syscall is available */ /* #undef HAVE_GETRANDOM_SYSCALL */ /* Define to 1 if you have the header file. */ /*

[issue36843] AIX build fails with failure to get random numbers

2019-05-08 Thread Robert Boehne
Change by Robert Boehne : Added file: https://bugs.python.org/file48317/config.log.gz ___ Python tracker ___ ___ Python-bugs-list mailing

[issue36843] AIX build fails with failure to get random numbers

2019-05-07 Thread STINNER Victor
STINNER Victor added the comment: Try to compress config.log to attach it. Or at least attach the output of "./configure" as a file. I'm looking for HAVE_GETRANDOM, HAVE_GETRANDOM_SYSCALL, HAVE_GETENTROPY defines that you can find in pyconfig.h. About /dev/urandom: does this device exist?

[issue36843] AIX build fails with failure to get random numbers

2019-05-07 Thread Christian Heimes
Christian Heimes added the comment: Could you please use a debugger and step through _Py_HashRandomization_Init and pyurandom to see, where the initialization of the RNG is failing? -- nosy: +christian.heimes ___ Python tracker

[issue36843] AIX build fails with failure to get random numbers

2019-05-07 Thread Jason Madden
Change by Jason Madden : -- nosy: +jmadden ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36843] AIX build fails with failure to get random numbers

2019-05-07 Thread Robert Boehne
/lib:/lib:/opt/Python-3.7/lib -q64 ' OPT='-DNDEBUG -O' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ../../Python-3.7.3/setup.py build Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python Makefile:626: recipe for target 'sharedmods

[issue36843] AIX build fails with failure to get random numbers

2019-05-07 Thread Robert Boehne
New submission from Robert Boehne : build fails with: ./python -E ../../Python-3.7.3/setup.py build Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python -- components: Build messages: 341821 nosy: Robert Boehne priority: normal severity

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2019-04-27 Thread Miro Hrončok
Miro Hrončok added the comment: Relevant NumPy issue: https://github.com/numpy/numpy/issues/13412 -- nosy: +hroncok ___ Python tracker ___

Re: Design a function that finds all positive numbers

2019-04-09 Thread Ben Bacarisse
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Ben Bacarisse writes: >>Ranjith Bantu writes: >>>can I solve any problems like this by learning python? >>You need to learn how to solve problems as well as learning Python -- > > I do not separate "solving the problem" from "using Python", >

Design a function that finds all positive numbers

2019-04-09 Thread Ranjith Bantu
A numeric array of length 'N' is given. you need to design a function that finds all positive numbers in the array that have their opposites in it swell. give the approach for solving the optimal average or best case performance. answer will be your obsolute. Array: -7,4,-3, 2, 2, -8, -2, 3, 3

RE: Design a function that finds all positive numbers

2019-04-09 Thread Schachner, Joseph
I'm willing to bet "sorted" is a sort of the list of strings. The result is certainly not what I'd expect if the list contained numeric values. So: make a new list that holds the values in your "Array" (which is probably a list) converted to numbers. Sort the new lis

Re: Design a function that finds all positive numbers

2019-04-09 Thread Ben Bacarisse
Ranjith Bantu writes: > A numeric array of length 'N' is given. you need to design a function > that finds all positive numbers in the array that have their opposites > in it swell. give the approach for solving the optimal average or best > case performance. answer will be y

[issue14453] profile.Profile.calibrate can produce incorrect numbers in some circumstances

2019-03-15 Thread Mark Lawrence
Change by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33329] sigaddset() can fail on some signal numbers

2019-03-03 Thread Larry Hastings
Larry Hastings added the comment: Now fixed in 3.4 and 3.5. I can cut the RCs. Huzzah! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33329] sigaddset() can fail on some signal numbers

2019-03-03 Thread Larry Hastings
Larry Hastings added the comment: New changeset 2226139aa2b69047cb54dbcfd79f5c2e36f98653 by larryhastings (Cheryl Sabella) in branch '3.4': [3.4] bpo-33329: Fix multiprocessing regression on newer glibcs (GH-6575) (#12145)

[issue33329] sigaddset() can fail on some signal numbers

2019-03-03 Thread Larry Hastings
Larry Hastings added the comment: New changeset 8ec1fd11f2d524859cfefae76458fcfd22decf65 by larryhastings (Cheryl Sabella) in branch '3.5': [3.5] bpo-33329: Fix multiprocessing regression on newer glibcs (GH-6575) (#12144)

[issue33329] sigaddset() can fail on some signal numbers

2019-03-03 Thread Cheryl Sabella
Change by Cheryl Sabella : -- pull_requests: +12145 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33329] sigaddset() can fail on some signal numbers

2019-03-03 Thread Cheryl Sabella
Change by Cheryl Sabella : -- pull_requests: +12144 stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list

Re: Version numbers in Standard Library

2019-03-03 Thread Thomas Jollans
On 01/03/2019 16:35, Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC] via Python-list wrote: > Dear Python List, > > A question. I help maintain a Python stack for users in my division here > at NASA and one user asked about updating the re module to 2.4. I > believe because he

[issue33329] sigaddset() can fail on some signal numbers

2019-03-01 Thread Miro Hrončok
Miro Hrončok added the comment: I am not able to do PRs right now but here are the Fedora patches: https://src.fedoraproject.org/rpms/python34/blob/master/f/00302-fix-multiprocessing-regression-on-newer-glibcs.patch

[issue33329] sigaddset() can fail on some signal numbers

2019-03-01 Thread Larry Hastings
Larry Hastings added the comment: These issues also occur on Python 3.4 and 3.5. And I'm now upgraded to Ubuntu 18.10 which I guess has the new version of glibc. The regression test suite for both 3.4 and 3.5 blocks forever on three tests (multiprocessing_fork, multiprocessing_forkserver,

Re: Version numbers in Standard Library

2019-03-01 Thread Skip Montanaro
The point of the "Changed in version ..." or "New in version ..." bits in the documentation is to alert readers who maintain software which needs to remain backward compatible with older versions of Python. If you maintain a package which you support for Python 3.4, 3.5, 3.6, and 3.7, you'll

Version numbers in Standard Library

2019-03-01 Thread Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC] via Python-list
Dear Python List, A question. I help maintain a Python stack for users in my division here at NASA and one user asked about updating the re module to 2.4. I believe because he read the docs: https://docs.python.org/2.7/library/re.html where you see lines like "New in version 2.4" and he

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2019-02-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2019-02-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 6a44f6eef3d0958d2347190b3e2d1222c2e9 by Serhiy Storchaka in branch 'master': bpo-36048: Use __index__() instead of __int__() for implicit conversion if available. (GH-11952)

Re: Custom logging code(s) / numbers to the log level Error

2019-02-22 Thread Peter Otten
kibt...@gmail.com wrote: > I wanted to write/extend the logging library to have a custom Error number > for each exception (error) the code has. What's the best approach for > this? If possible can someone please provide a good starting code snippet. > Thanks You can pass arbitrary data via the

Custom logging code(s) / numbers to the log level Error

2019-02-22 Thread kibtes2
I wanted to write/extend the logging library to have a custom Error number for each exception (error) the code has. What's the best approach for this? If possible can someone please provide a good starting code snippet. Thanks -- https://mail.python.org/mailman/listinfo/python-list

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2019-02-20 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: > I am not sure what to with the int constructor. Should it try __index__ > before __int__? Or just make __index__ without __int__ setting the nb_int > slot as was proposed by Nick in issue33039? Shouldn't it try only __int__ since this will default to

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2019-02-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am not sure what to with the int constructor. Should it try __index__ before __int__? Or just make __index__ without __int__ setting the nb_int slot as was proposed by Nick in issue33039? -- ___ Python

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2019-02-20 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-34423: "Overflow when casting from double to time_t, and_PyTime_t" or "How to reduce precision loss when converting arbitrary number to int or float?". -- ___ Python tracker

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2019-02-20 Thread STINNER Victor
Change by STINNER Victor : -- title: Deprecate implicit truncating when convert Python numbers to C integers -> Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__ ___ Python tracker <

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers

2019-02-20 Thread STINNER Victor
STINNER Victor added the comment: I like the idea. Rejecting float but not decimal.Decimal is inconsistent. __index__ has been written explicitly for this purpose. I'm always confused and lost in subtle details of the Python and C API in how they handle numbers, so I wrote some notes

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers

2019-02-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Numerous explicit calls of PyNumber_Index() which are used to protect from passing non-integral types to PyLong_AsLong() and like can be removed after the end of the deprecation period. I tried to mark calls which can be removed with comments, but

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers

2019-02-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers

2019-02-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +11977 stage: -> patch review ___ Python tracker ___ ___

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers

2019-02-19 Thread Serhiy Storchaka
l be used only in the int constructor. -- components: Interpreter Core messages: 336041 nosy: mark.dickinson, serhiy.storchaka, vstinner priority: normal severity: normal status: open title: Deprecate implicit truncating when convert Python numbers to C integers t

Re: Sum of few numbers by using for and range

2019-02-17 Thread DL Neil
On 18/02/19 8:32 AM, Chris Angelico wrote: On Mon, Feb 18, 2019 at 6:12 AM DL Neil wrote: The reason this course caught my attention (and which is relevant to you, per Chris' and Dennis' recent advice) is that the course revolves around an 'active textbook'. This intersperses learning material

Re: Sum of few numbers by using for and range

2019-02-17 Thread Chris Angelico
On Mon, Feb 18, 2019 at 6:12 AM DL Neil wrote: > > sure you truly understand what is going on. Try to piece together what > > a section of code is doing, step by step. Write down on a piece of > > paper what the variables are at each point in the program. Then, AFTER > > doing the work manually,

Re: Sum of few numbers by using for and range

2019-02-17 Thread DL Neil
^Bart, Which course are you attempting? What are you using as learning material? (it seems ineffectual) - further comments interspersed, below:- On 18/02/19 5:30 AM, Chris Angelico wrote: On Mon, Feb 18, 2019 at 3:26 AM ^Bart wrote: I need to do what I wrote in the subject but... I don't

Re: Sum of few numbers by using for and range

2019-02-17 Thread Chris Angelico
On Mon, Feb 18, 2019 at 3:26 AM ^Bart wrote: > > Hello! > > I need to do what I wrote in the subject but... I don't understand how > could I fix my code... :\ > > number1 = int( input("Insert the first number:")) > number2 = int( input("Insert the second number:")) > number3 = int( input("Insert

Sum of few numbers by using for and range

2019-02-17 Thread ^Bart
Hello! I need to do what I wrote in the subject but... I don't understand how could I fix my code... :\ number1 = int( input("Insert the first number:")) number2 = int( input("Insert the second number:")) number3 = int( input("Insert the third number:")) print("Total amount is:") for x in

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

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.

Re: The sum of ten numbers inserted from the user

2019-02-08 Thread ^Bart
x = 0 for jnk in range(10): x += int(input("Enter a number: ") print(x) It works, there's a missed ) A colleague did: total=0 for n in range(10): n= int(input("Enter a number: ")) total=total+n print(total) I understood your code is more clean! ^Bart --

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Ben Bacarisse
Grant Edwards writes: > On 2019-02-07, Ben Bacarisse wrote: >> Ian Clark writes: >> >>> This is my whack at it, I can't wait to hear about it being the wrong big o >>> notation! >>> >>> numbers=[] >>> >>> while len(n

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Ben Bacarisse
Bart writes: > On 07/02/2019 20:45, Ben Bacarisse wrote: >> Ian Clark writes: >> >>> This is my whack at it, I can't wait to hear about it being the wrong big o >>> notation! >>> >>> numbers=[] >>> >>> while len(numbers) <

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Grant Edwards
On 2019-02-07, Ben Bacarisse wrote: > Ian Clark writes: > >> This is my whack at it, I can't wait to hear about it being the wrong big o >> notation! >> >> numbers=[] >> >> while len(numbers) < 10: >> try: >> chip = int(inp

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Ben Bacarisse
Ian Clark writes: > This is my whack at it, I can't wait to hear about it being the wrong big o > notation! > > numbers=[] > > while len(numbers) < 10: > try: > chip = int(input('please enter an integer: ')) > except ValueError: > print

RE: The sum of ten numbers inserted from the user

2019-02-07 Thread Schachner, Joseph
removed. --- Joe S. From: Ian Clark Sent: Thursday, February 7, 2019 1:27 PM To: Schachner, Joseph Cc: python-list@python.org Subject: Re: The sum of ten numbers inserted from the user This is my whack at it, I can't wait to hear about it being the wrong big o notation! numbers=[] while len

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Ian Clark
This is my whack at it, I can't wait to hear about it being the wrong big o notation! numbers=[] while len(numbers) < 10: try: chip = int(input('please enter an integer: ')) except ValueError: print('that is not a number, try again') else: numbers.append(c

RE: The sum of ten numbers inserted from the user

2019-02-07 Thread Schachner, Joseph
= y print( "The sum is: ", sum) -Original Message- From: ^Bart Sent: Thursday, February 7, 2019 6:30 AM To: python-list@python.org Subject: The sum of ten numbers inserted from the user I thought something like it but doesn't work... for n in range(1, 11): x = inp

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Joel Goldstick
On Thu, Feb 7, 2019 at 6:31 AM ^Bart wrote: > > I thought something like it but doesn't work... > > for n in range(1, 11): > x = input("Insert a number: ") The above, keeps replacing x with each input value. You don't want that. Think about appending the input value to a list > > for y in

The sum of ten numbers inserted from the user

2019-02-07 Thread ^Bart
I thought something like it but doesn't work... for n in range(1, 11): x = input("Insert a number: ") for y in range(x): sum = y print ("The sum is: ",y) -- https://mail.python.org/mailman/listinfo/python-list

[issue35841] Datetime strftime() does not return correct week numbers for 2019

2019-02-02 Thread Steve Dower
Change by Steve Dower : -- nosy: -steve.dower ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Ian Clark
d not possibly be run in a Python interpreter, I think. >> >> --- Joseph S. >> >> From: Adrian Ordona >> Sent: Tuesday, January 29, 2019 2:52 PM >> To: Schachner, Joseph >> Cc: Dan Sommers <2qdxy4rzwzuui...@potatochowder.com>; >> python-list@python.org >&g

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Ian Clark
sibly be run in a Python interpreter, I think. > > --- Joseph S. > > From: Adrian Ordona > Sent: Tuesday, January 29, 2019 2:52 PM > To: Schachner, Joseph > Cc: Dan Sommers <2qdxy4rzwzuui...@potatochowder.com>; > python-list@python.org > Subject: Re: Exercize to und

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Ian Clark
threw this together, let me know what you think num_list=[] name_list = ['first','second','third','fourth','fifth','sixth','seventh','eighth','ninth','tenth'] name_it = name_list.pop(0) while len(num_list) < 3: try: num_list.append( int( input(f"Insert the {name_it} number: "))) except

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Ian Clark
Like this? num_max = 0 num_index = 0 name_list = ['first','second','third','fourth','fifth','sixth','seventh','eighth','ninth','tenth'] name_it = name_list.pop(0) while num_index <3: try: num_list = int( input(f"Insert the {name_it} number: ")) except ValueError: print('Not a number, try

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Chris Angelico
On Wed, Jan 30, 2019 at 8:20 AM Bob van der Poel wrote: > Isn't the easiest way to do this is: > > sorted( [n1,n2,n3] )[-1] > > to get the largest value? >>> help(max) But the point of this exercise is not to use sorted() or max(). ChrisA --

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Bob van der Poel
On Tue, Jan 29, 2019 at 12:52 PM Adrian Ordona wrote: > i'm also a beginner reading all the replies helps. > i was trying the problem myself and came up with the below code with a > users input. > > > num1 = int(input("Enter first number: "))num2 = int(input("Enter second > number: "))num3 =

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Adrian Ordona
9 2:52 PM >> To: Schachner, Joseph >> Cc: Dan Sommers <2qdxy4rzwzuui...@potatochowder.com>; python-list@python.org >> Subject: Re: Exercize to understand from three numbers which is more high >> >> i'm also a beginner reading all the replies helps. >> i wa

RE: Exercize to understand from three numbers which is more high

2019-01-29 Thread Schachner, Joseph
com>; python-list@python.org Subject: Re: Exercize to understand from three numbers which is more high i'm also a beginner reading all the replies helps. i was trying the problem myself and came up with the below code with a users input. num1 = int(input("Enter first number: "))

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Adrian Ordona
i'm also a beginner reading all the replies helps. i was trying the problem myself and came up with the below code with a users input. num1 = int(input("Enter first number: "))num2 = int(input("Enter second number: "))num3 = int(input("Enter third number: "))if num1 > num2 and num1 > num3:

RE: Exercize to understand from three numbers which is more high

2019-01-29 Thread Schachner, Joseph
Explanation: 5 > 4 so it goes into the first if. 5 is not greater than 6, so it does not assign N1 to MaxNum. The elif (because of the lack of indent) applies to the first if, so nothing further is executed. Nothing has been assigned to MaxNum, so that variable does not exist. You're right,

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread MRAB
On 2019-01-29 16:02, Dan Sommers wrote: On 1/29/19 9:27 AM, Jack Dangler wrote: wow. Seems like a lot going on. You have 3 ints and need to determine the max? Doesn't this work? N1, N2, N3 if N1>N2   if N1>N3     MaxNum = N1 elif N2>N3   MaxNum = N2 elif N1 No. Assuing that you meant

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Dan Sommers
On 1/29/19 9:27 AM, Jack Dangler wrote: wow. Seems like a lot going on. You have 3 ints and need to determine the max? Doesn't this work? N1, N2, N3 if N1>N2   if N1>N3     MaxNum = N1 elif N2>N3   MaxNum = N2 elif N1 No. Assuing that you meant to include colons where I think you did,

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Jack Dangler
e: number1 = int( input("Insert the first number: ")) number2 = int( input("Insert the second number: ")) number3 = int( input("Insert the third number: ")) [snip stuff that doesn’t work] But it doesn't work... :\ You have got to a starting point - you have thre

Re: Exercize to understand from three numbers which is more high

2019-01-29 Thread Jack Dangler
nputs." return None  # To be replaced. I need to do this exercize just by using if, elif and else, in the next lesson we'll discuss other kind of rules! :) So I need to insert three int numbers and I should show which is the high, the middle and the min. # Exercize 305 number1 = int( inp

[issue35841] Datetime strftime() does not return correct week numbers for 2019

2019-01-29 Thread Emmanuel Arias
Emmanuel Arias added the comment: > I believe this ticket can be closed. Yes, I think so. How you say, on 35535 there is a detailed explanation about the behavior. -- nosy: +eamanu ___ Python tracker

[issue35841] Datetime strftime() does not return correct week numbers for 2019

2019-01-29 Thread Tommy Rowland
Tommy Rowland added the comment: Hi Paul, Thank you for the clarification. I can see that %V does indeed return the correct week number. It seems that when calling strftime, it is possible to use this in conjunction with %y, but when calling strptime, it is not. Is this also intended

[issue35841] Datetime strftime() does not return correct week numbers for 2019

2019-01-28 Thread Paul Ganssle
Paul Ganssle added the comment: I think this is not a bug. bpo-35535 is probably also intended behavior, but that is less certain. The misunderstanding here is that %W does not give you the ISO week number, from the documentation: %W: Week number of the year (Monday as the first day of

[issue35841] Datetime strftime() does not return correct week numbers for 2019

2019-01-28 Thread Paul Ganssle
Paul Ganssle added the comment: Possibly related to 35535. -- nosy: +p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing

[issue35841] Datetime strftime() does not return correct week numbers for 2019

2019-01-28 Thread Tommy Rowland
: normal status: open title: Datetime strftime() does not return correct week numbers for 2019 type: behavior versions: Python 2.7, Python 3.6 Added file: https://bugs.python.org/file48083/Python Datetime Issue.JPG ___ Python tracker <https://bugs.python.

Re: Exercize to understand from three numbers which is more high

2019-01-28 Thread Frank Millman
"^Bart" wrote in message news:q2mghh$ah6$1...@gioia.aioe.org... > 1. The last two lines appear to be indented under the 'if number3 < ' > line. I think you want them to be unindented so that they run every > time. I'm sorry but I didn't completely understand what you wrote about the last

Re: Exercize to understand from three numbers which is more high

2019-01-28 Thread ^Bart
Excellent! Glad I could help. Thank you! :) I'm studying Python everyday and I try to do the best! :) 1. The last two lines appear to be indented under the 'if number3 < ' line. I think you want them to be unindented so that they run every time. I'm sorry but I didn't completely understand

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread Frank Millman
"^Bart" wrote in message news:q2kh0t$1hnj$1...@gioia.aioe.org... > You have got to a starting point - you have three numbers. Good. > > Where do you do go from here? > > I would start with two of the numbers, and work out which one is higher. # SOLVED!!! number1 = int

Re: Exercize to understand from three numbers which is more high

2019-01-27 Thread ^Bart
as a follow on exercise if you have covered them yet, convert your code into a function takes the 3 numbers as parameters. you will find as you progress it is a better way of structuring your program & increases flexibility. Next step will be to study functions and I'll have other

<    1   2   3   4   5   6   7   8   9   10   >