Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Marko Rauhamaa
Andreas Röhler : > Indeed, why should the result of 4 - 4 have a different truth-value > than 4 - 3 ? This implementation seems to be a legacy from languages > without boolean types. In Lisp, only nil (= the empty list) is accepted as false, everything else is considered true. In Scheme, only #f

Re: Can math.atan2 return INF?

2016-06-22 Thread Steven D'Aprano
On Thursday 23 June 2016 14:40, Dan Sommers wrote: >> Since x == y, the answer should be the same as for any other pair of x == y. > > When x == y == 0, then atan2(y, x) is 0. /s/any other pair of x == y/any other pair of x y except for zero/ :-P Zero is exceptional in many ways. -- Steve

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Andreas Röhler
On 23.06.2016 06:47, Lawrence D’Oliveiro wrote: On Thursday, June 23, 2016 at 3:12:52 PM UTC+12, Larry Hudson wrote: On 06/22/2016 12:42 AM, Lawrence D’Oliveiro wrote: * boolean operators don’t have to operate on boolean values. The language spec

Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-22 Thread Pushpanth Gundepalli
On Tuesday, June 21, 2016 at 4:33:28 PM UTC+5:30, Pushpanth Gundepalli wrote: > Guys, can you please share me some sites where we can practice python > programs for beginners and Intermediate. Thank you for ur valuable suggestions.. Actually i have done practising the exercises on codeacademy, c

Re: Break and Continue: While Loops

2016-06-22 Thread Rustom Mody
On Thursday, June 23, 2016 at 9:47:23 AM UTC+5:30, Elizabeth Weiss wrote: > CODE #1: > > i=0 > while 1==1: >print(i) >i=i+1 >if i>=5: > print("Breaking") > break > > -- > I understand that i=0 and i will only be printed if 1=1 > The results of this is > 0 > 1 > 2 > 3 > 4

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Rustom Mody
On Thursday, June 23, 2016 at 10:17:16 AM UTC+5:30, Lawrence D’Oliveiro wrote: > On Thursday, June 23, 2016 at 3:12:52 PM UTC+12, Larry Hudson wrote: > > On 06/22/2016 12:42 AM, Lawrence D’Oliveiro wrote: > >> * boolean operators don’t have to operate on boolean values. The > >> language spec > >

Re: Multiline parsing of python compiler demistification needed

2016-06-22 Thread Lawrence D’Oliveiro
On Thursday, June 16, 2016 at 8:34:46 PM UTC+12, Yubin Ruan wrote: > print "A test case" + \ >"str_1[%s] " + \ >"str_2[%s] " % (str_1, str_2) Try this: print \ ( "A test case" "str_1[%s] " "str_2[%s] " % (str_1, str_2) ) Python takes this n

Re: Break and Continue: While Loops

2016-06-22 Thread Lawrence D’Oliveiro
On Thursday, June 23, 2016 at 4:17:23 PM UTC+12, Elizabeth Weiss wrote: > > i=0 > while 1==1: >print(i) >i=i+1 >if i>=5: > print("Breaking") > break > > Why is Breaking going to be printed if i only goes up to 4? It does say if > i>=5? Because you incremented i after printi

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Lawrence D’Oliveiro
On Thursday, June 23, 2016 at 3:12:52 PM UTC+12, Larry Hudson wrote: > On 06/22/2016 12:42 AM, Lawrence D’Oliveiro wrote: >> * boolean operators don’t have to operate on boolean values. The >> language spec >> >> says:

Re: Can math.atan2 return INF?

2016-06-22 Thread Dan Sommers
On Thu, 23 Jun 2016 13:59:46 +1000, Steven D'Aprano wrote: > Given: > > x = INF > y = INF > assert x == y > > there is a reason to pick atan2(y, x) = pi/4: > > Since x == y, the answer should be the same as for any other pair of x == y. When x == y == 0, then atan2(y, x) is 0. -- https://mail

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Elizabeth Weiss
On Wednesday, June 22, 2016 at 11:59:44 PM UTC-4, Steven D'Aprano wrote: > On Thu, 23 Jun 2016 01:12 pm, Larry Hudson wrote: > > > On 06/22/2016 12:42 AM, Lawrence D’Oliveiro wrote: > > [snip] > >> I feel that’s a needlessly complicated rule. It would have been simpler > >> if boolean operators (a

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Elizabeth Weiss
On Wednesday, June 22, 2016 at 3:42:24 AM UTC-4, Lawrence D’Oliveiro wrote: > On Wednesday, June 22, 2016 at 3:40:22 PM UTC+12, Elizabeth Weiss wrote: > > I am a little confused as to how this is False: > > > > False==(False or True) > > > > I would think it is True because False==False is true.

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Elizabeth Weiss
On Wednesday, June 22, 2016 at 3:15:02 AM UTC-4, Jussi Piitulainen wrote: > Christian Gollwitzer writes: > > > Am 22.06.16 um 05:40 schrieb Elizabeth Weiss: > >> I am a little confused as to how this is False: > >> > >> False==(False or True) > >> > >> I would think it is True because False==False

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Elizabeth Weiss
On Tuesday, June 21, 2016 at 11:59:37 PM UTC-4, Ben Finney wrote: > Elizabeth Weiss > writes: > > > Hi There, > > Welcome! Your questions are fine here, but you may like to know that we > also have a beginner-specific forum for collaborative tutoring > https://mail.python.org/mailman/listinfo/tu

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Elizabeth Weiss
On Tuesday, June 21, 2016 at 11:59:37 PM UTC-4, Ben Finney wrote: > Elizabeth Weiss > writes: > > > Hi There, > > Welcome! Your questions are fine here, but you may like to know that we > also have a beginner-specific forum for collaborative tutoring > https://mail.python.org/mailman/listinfo/tu

Break and Continue: While Loops

2016-06-22 Thread Elizabeth Weiss
CODE #1: i=0 while 1==1: print(i) i=i+1 if i>=5: print("Breaking") break -- I understand that i=0 and i will only be printed if 1=1 The results of this is 0 1 2 3 4 Breaking Why is Breaking going to be printed if i only goes up to 4? It does say if i>=5? Shouldn't this me

Re: Can math.atan2 return INF?

2016-06-22 Thread Steven D'Aprano
On Thu, 23 Jun 2016 05:17 am, Ben Bacarisse wrote: > pdora...@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) writes: > >> Ben Bacarisse wrote: >> >>> >>> math.atan2(INF, INF) >>> 0.7853981633974483 >>> >>> I would have expected NaN since atan2(INF, INF) could be thought of as >>> the limit

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Steven D'Aprano
On Thu, 23 Jun 2016 01:12 pm, Larry Hudson wrote: > On 06/22/2016 12:42 AM, Lawrence D’Oliveiro wrote: > [snip] >> I feel that’s a needlessly complicated rule. It would have been simpler >> if boolean operators (and conditional expressions like in if-statements >> and while-statements) only allowe

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Larry Hudson via Python-list
On 06/22/2016 12:42 AM, Lawrence D’Oliveiro wrote: [snip] I feel that’s a needlessly complicated rule. It would have been simpler if boolean operators (and conditional expressions like in if-statements and while-statements) only allowed values of boolean types. But that’s one of the few warts

Re: Is signed zero always available?

2016-06-22 Thread Grant Edwards
On 2016-06-22, Christopher Reimer wrote: >> On Jun 22, 2016, at 7:59 AM, Grant Edwards wrote: >> >>> On 2016-06-22, Random832 wrote: On Wed, Jun 22, 2016, at 10:19, Grant Edwards wrote: Is that guaranteed by Python, or just a side-effect of the implementation? Back in the

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-22 Thread Lawrence D’Oliveiro
On Thursday, June 23, 2016 at 2:02:18 PM UTC+12, Rustom Mody wrote: > So remembered that there is one method -- yes clunky -- that I use most -- > forgot to mention -- C-x 8 RET > ie insert-char¹ > > Which takes the name (or hex) of the unicode char. A handy tool for looking up names and codes

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-22 Thread Rustom Mody
On Tuesday, June 21, 2016 at 7:27:00 PM UTC+5:30, Rustom Mody wrote: > >https://wiki.archlinux.org/index.php/Keyboard_configuration_i > >n_Xorg> -- no good You probably want this: https://wiki.archlinux.org/index.php/X_KeyBoard_extension#Editing_the_layout > > So Rustom, how do *you* prod

Re: Is signed zero always available?

2016-06-22 Thread Steven D'Aprano
On Thu, 23 Jun 2016 08:50 am, Christopher Reimer wrote: > When I took mathematics in college, the following was true: > > -1 * 0 = 0 > > I would probably have gotten rapped on the knuckles by my instructors if I > answered -0. Zero was zero. No plus or minus about that. No discussion of > signed

Re: Why my process cannot terminate when Pipe Connection is closed

2016-06-22 Thread Lawrence D’Oliveiro
On Thursday, June 23, 2016 at 10:50:10 AM UTC+12, Ke Wang wrote: > Raises EOFError if there is nothing left to receive and the other end was > closed. Does the parent process have to close the sending end of the pipe as well? Otherwise the receiver never gets EOF as long as one process still has

Re: Is signed zero always available?

2016-06-22 Thread Michael Selik
On Wed, Jun 22, 2016 at 4:53 PM Christopher Reimer < christopher_rei...@icloud.com> wrote: > > On Jun 22, 2016, at 7:59 AM, Grant Edwards > wrote: > > > >> On 2016-06-22, Random832 wrote: > >>> On Wed, Jun 22, 2016, at 10:19, Grant Edwards wrote: > >>> > >>> Is that guaranteed by Python, or just

Re: Is signed zero always available?

2016-06-22 Thread Christopher Reimer
> On Jun 22, 2016, at 7:59 AM, Grant Edwards wrote: > >> On 2016-06-22, Random832 wrote: >>> On Wed, Jun 22, 2016, at 10:19, Grant Edwards wrote: >>> >>> Is that guaranteed by Python, or just a side-effect of the >>> implementation? Back in the days when Python used native C >>> integers I thi

Re: Unexpected NANs in complex arithmetic

2016-06-22 Thread Dan Sommers
On Wed, 22 Jun 2016 16:30:49 +1000, Chris Angelico wrote: > On Wed, Jun 22, 2016 at 4:17 PM, Steven D'Aprano > wrote: >> On Wednesday 22 June 2016 13:54, Dan Sommers wrote: >> >>> By the time Python returns a result for inf+3j, you're already in >>> trouble (or perhaps Python is already in troubl

Why my process cannot terminate when Pipe Connection is closed

2016-06-22 Thread Ke Wang
import multiprocessing as mp def send(conn): """send obj to pipe""" for i in range(10): conn.send(i) print("send:", i) conn.close() def transform(func, conn): """receive input from pipe, transform it""" try: while True: i = conn.recv()

Re: [tkinter] widget size adjustment

2016-06-22 Thread Christian Gollwitzer
Am 22.06.16 um 23:18 schrieb Zachary Ware: On Wed, Jun 22, 2016 at 4:05 PM, Christian Gollwitzer wrote: BTW, the Tkinter wrapper is a bit clumsy for this option. In the original Tk, the sticky option is just a string. You can still pass that and do sticky='nsew' instead of the clumsy

Re: value of pi and 22/7

2016-06-22 Thread Lawrence D’Oliveiro
On Tuesday, June 21, 2016 at 10:24:46 AM UTC+12, Wildman wrote: > I am not convinced on any of the theories on how the pyramids > were built, or any other of the monolithic sites. “Reality is that which, when you stop believing in it, doesn’t go away.” -- Philip K

Re: [tkinter] widget size adjustment

2016-06-22 Thread Zachary Ware
On Wed, Jun 22, 2016 at 4:05 PM, Christian Gollwitzer wrote: > BTW, the Tkinter wrapper is a bit clumsy for this option. In the original > Tk, the sticky option is just a string. You can still pass that and do > > sticky='nsew' > > instead of the clumsy > > sticky=Tkinter.N+Tkinter

Zachary, Iremen, and BartC

2016-06-22 Thread Michael Smolen
Thanks!!! With your advice and suggestions I finally got Python installed. I used windows x86 MS Installer and it worked with three clicks. Thanks again, and again, and mike -- https://mail.python.org/mailman/listinfo/python-list

Re: [tkinter] widget size adjustment

2016-06-22 Thread Christian Gollwitzer
Am 22.06.16 um 22:53 schrieb Pierre-Alain Dorange: Christian Gollwitzer wrote: If you do not see the background, then indeed the canvas is not resized, which means the gridding options are wrong. Looking at your code, I see this: self.map.grid(row=1,column=1,rowspan=4,columnspan=2,padx=2,pady=

Re: [tkinter] widget size adjustment

2016-06-22 Thread Pierre-Alain Dorange
Christian Gollwitzer wrote: > > If you do not see the background, then indeed the canvas is not resized, > which means the gridding options are wrong. Looking at your code, I see > this: > > self.map.grid(row=1,column=1,rowspan=4,columnspan=2,padx=2,pady=2) > > Here, you do not specify any sti

Re: [tkinter] widget size adjustment

2016-06-22 Thread Christian Gollwitzer
Am 22.06.16 um 19:42 schrieb Pierre-Alain Dorange: Christian Gollwitzer wrote: Perhaps your assumption is wrong. Maybe the canvas itself *is* resized, so the white space you see around the image is the background of the canvas. To test this easily, set a strong color for the background:

Re: Can math.atan2 return INF?

2016-06-22 Thread Lawrence D’Oliveiro
On Thursday, June 23, 2016 at 7:17:37 AM UTC+12, Ben Bacarisse wrote: > The limit of atan2(x, x) is as you describe, but there is no reason to > pick that one case. It’s what’s called a “non-removable discontinuity”. The value you pick at that point will be consistent with approaching it from on

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Erik
On 22/06/16 04:40, Elizabeth Weiss wrote: I am a little confused as to how this is False: False==(False or True) Other people have explained why the expression evaluates as it does - the sub-expression "False or True" evaluates to True (as one of the operands is truthy). Your expression then

Re: Can math.atan2 return INF?

2016-06-22 Thread Ben Bacarisse
pdora...@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) writes: > Ben Bacarisse wrote: > >> >>> math.atan2(INF, INF) >> 0.7853981633974483 >> >> I would have expected NaN since atan2(INF, INF) could be thought of as >> the limit of atan2(x, y) which could be any value in the range. And I'd

Re: OT?: Where can I find python programming material in different languages?

2016-06-22 Thread Chris Angelico
On Thu, Jun 23, 2016 at 2:59 AM, Joe Gulizia wrote: > Potentially Off Topic > Not at all off topic! A very reasonable question. > > I am looking for python programming related blogs, papers, videos in Swahili, > Tagalog, Somali, Javanese (Indonesian?), Lithuanian, Pashto, Bulgarian, > Farsi, A

Re: [tkinter] widget size adjustment

2016-06-22 Thread Pierre-Alain Dorange
Christian Gollwitzer wrote: > Perhaps your assumption is wrong. Maybe the canvas itself *is* resized, > so the white space you see around the image is the background of the > canvas. To test this easily, set a strong color for the background: > > blabla = tk.Canvas(..., bg='red') > > You

Re: Can math.atan2 return INF?

2016-06-22 Thread Pierre-Alain Dorange
Ben Bacarisse wrote: > >>> math.atan2(INF, INF) > 0.7853981633974483 > > I would have expected NaN since atan2(INF, INF) could be thought of as > the limit of atan2(x, y) which could be any value in the range. And I'd > have guessed atan2(0, 0) would have been NaN too but i'm not a math ex

Re: Setting up Python WinXP

2016-06-22 Thread Zachary Ware
Hi Michael, On Wed, Jun 22, 2016 at 11:41 AM, Michael Smolen <8smo...@tds.net> wrote: > Folks: > I can't wait to start programming with Python. Welcome to Python! > However, I am having difficulty installing on my XP operating system. This unsolicited advice is rather beside the point, but I wo

Re: Setting up Python WinXP

2016-06-22 Thread Irmen de Jong
On 22-6-2016 18:41, Michael Smolen wrote: > Folks: > I can't wait to start programming with Python. However, I am having > difficulty installing on my XP operating system. I downloaded Python-3.4.5ci > as that seems like the version that will run on my operating system. The > latest version will

Re: Setting up Python WinXP

2016-06-22 Thread BartC
On 22/06/2016 17:41, Michael Smolen wrote: Folks: I can't wait to start programming with Python. However, I am having difficulty installing on my XP operating system. I downloaded Python-3.4.5ci as that seems like the version that will run on my operating system. The latest version will not as

OT?: Where can I find python programming material in different languages?

2016-06-22 Thread Joe Gulizia
Potentially Off Topic I am looking for python programming related blogs, papers, videos in Swahili, Tagalog, Somali, Javanese (Indonesian?), Lithuanian, Pashto, Bulgarian, Farsi, Amharic, Georgian, Kazakh, and Tamil. Although blogs are not online I am looking for material that is not easily a

Setting up Python WinXP

2016-06-22 Thread Michael Smolen
Folks: I can't wait to start programming with Python. However, I am having difficulty installing on my XP operating system. I downloaded Python-3.4.5ci as that seems like the version that will run on my operating system. The latest version will not as per mention on the website. I downloaded the

Re: Summary grid

2016-06-22 Thread jmp
On 06/22/2016 04:46 PM, Jignesh Sutar wrote: Say I have list of data as given in the example code below, I want to find all the unique categories (alphabetic letters) and unique IDs (numbers) and then produce a summary grid as manually entered in the "results". How could I code this? Many thanks

Re: Can math.atan2 return INF?

2016-06-22 Thread Random832
On Wed, Jun 22, 2016, at 11:34, Ben Bacarisse wrote: > Steven D'Aprano writes: > > I think that the only way it will return a NAN is if passed a NAN. > > That seems to be the case but I was a little surprised to find that > > >>> math.atan2(INF, INF) > 0.7853981633974483 > > I would have ex

Re: while Loops

2016-06-22 Thread John Gordon
In <0cf9a94e-b84c-460d-b03d-edf6a941a...@googlegroups.com> Elizabeth Weiss writes: > Why is one of the results 5 since i=i+1? Should the maximum result > be 4 since 4 +1=5? "while i<=5" means "while i is less than or equal to 5". So the loop will keep going at 5, and only stop when i is 6. -

Re: Summary grid

2016-06-22 Thread Jussi Piitulainen
Jignesh Sutar writes: > Say I have list of data as given in the example code below, I want to find > all the unique categories (alphabetic letters) and unique IDs (numbers) and > then produce a summary grid as manually entered in the "results". How could > I code this? > > Many thanks in advance,

Re: Summary grid

2016-06-22 Thread Peter Otten
Jignesh Sutar wrote: > Say I have list of data as given in the example code below, I want to find > all the unique categories (alphabetic letters) and unique IDs (numbers) > and then produce a summary grid as manually entered in the "results". How > could I code this? > > Many thanks in advance,

Re: Can math.atan2 return INF?

2016-06-22 Thread Ben Bacarisse
Steven D'Aprano writes: > On Wed, 22 Jun 2016 04:01 am, Pierre-Alain Dorange wrote: >> I do not know under what circumstance atan2 can return NAN, atan2 taks 2 >> argument (y and x) and return the angle corresponding to y/x. >> If x is 0.0, atan2 return 0.0 (do not try to make the division). > >

Re: Is signed zero always available?

2016-06-22 Thread Grant Edwards
On 2016-06-22, Random832 wrote: > On Wed, Jun 22, 2016, at 10:19, Grant Edwards wrote: > >> Is that guaranteed by Python, or just a side-effect of the >> implementation? Back in the days when Python used native C >> integers I think the latter. > > AIUI, native C integers have never reliably supp

Summary grid

2016-06-22 Thread Jignesh Sutar
Say I have list of data as given in the example code below, I want to find all the unique categories (alphabetic letters) and unique IDs (numbers) and then produce a summary grid as manually entered in the "results". How could I code this? Many thanks in advance, Jignesh data= ["A.1", "A.2", "A.

Re: Is signed zero always available?

2016-06-22 Thread Random832
On Wed, Jun 22, 2016, at 10:19, Grant Edwards wrote: > Is that guaranteed by Python, or just a side-effect of the > implementation? Back in the days when Python used native C integers I > think the latter. AIUI, native C integers have never reliably supported signed zero even with representations

Re: Is signed zero always available?

2016-06-22 Thread Grant Edwards
On 2016-06-22, Steven D'Aprano wrote: > Both IEEE-754 floats and Decimals support signed zeroes, that is -0.0 and > 0.0 are two distinct (but equal) values. > > (There is only one int zero: -0 and 0 are the same value.) Is that guaranteed by Python, or just a side-effect of the implementation? B

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Random832
On Tue, Jun 21, 2016, at 23:40, Elizabeth Weiss wrote: > Hi There, > > I am a little confused as to how this is False: > > False==(False or True) > > I would think it is True because False==False is true. "False or True" is True, and then it reduces to "False == True" which is false. There's

Is signed zero always available?

2016-06-22 Thread Steven D'Aprano
Both IEEE-754 floats and Decimals support signed zeroes, that is -0.0 and 0.0 are two distinct (but equal) values. (There is only one int zero: -0 and 0 are the same value.) Signed Decimal zero should always be available. What about signed float zero? Are there any platforms where Python is avail

Re: EuroPython 2016 Conference App - Ready for installation

2016-06-22 Thread Steven D'Aprano
On Wed, 22 Jun 2016 10:31 pm, M.-A. Lemburg wrote: > You can create a profile within the app (or link this to your existing > social accounts), share messages and photos, and easily reach out to > other fellow attendees. o_O I have no words. -- Steven -- https://mail.python.org/mailman/list

EuroPython 2016 Conference App - Ready for installation

2016-06-22 Thread M.-A. Lemburg
We are proud to announce our very own mobile app for the EuroPython 2016 conference: *** EuroPython 2016 Conference App *** https://ep2016.europython.eu/en/events/conference-app/ Engage with the conference and its attendees T

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-22 Thread Tim Chase
On 2016-06-22 00:55, Lawrence D’Oliveiro wrote: > On Wednesday, June 22, 2016 at 7:50:50 AM UTC+12, Tim Chase wrote: >> I have a ~/.XCompose file that contains something like > > You may find your custom XCompose is ignored by certain GUI apps. > This is because the GUI toolkits they are using nee

Fwd: Operator Precedence/Boolean Logic

2016-06-22 Thread Jorge Gimeno
On Tue, Jun 21, 2016 at 8:40 PM, Elizabeth Weiss wrote: > Hi There, > > I am a little confused as to how this is False: > > False==(False or True) > > I would think it is True because False==False is true. > > I think the parenthesis are confusing me. > > (False==False) or True > > This is True.

Re: the global keyword:

2016-06-22 Thread BartC
On 22/06/2016 01:24, Rick Johnson wrote: On Tuesday, June 21, 2016 at 6:16:09 PM UTC-5, BartC wrote: I tried using your method but it didn't work: ...you'll find a thread i authored, that includes an object exposing a global namespace named "G". Details of how to inject the symbol G are inc

Re: Unexpected NANs in complex arithmetic

2016-06-22 Thread Oscar Benjamin
On 22 June 2016 at 08:14, Antoon Pardon wrote: > Op 22-06-16 om 04:48 schreef Steven D'Aprano: >> I'm doing some arithmetic on complex numbers involving INFs, and getting >> unexpected NANs. >> >> py> INF = float('inf') >> py> z = INF + 3j >> py> z >> (inf+3j) >> py> -z >> (-inf-3j) >> >> So far,

Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-22 Thread John Wong
On Wed, Jun 22, 2016 at 4:45 AM, Nick Sarbicki wrote: > On Wed, Jun 22, 2016 at 9:42 AM Miki Tebeka wrote: > > > IMO you can do that at https://www.codecademy.com/learn/python > > > > Some people might think differently but I wouldn't recommend a python > course which teaches 2.7 over 3.x. > > p

Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-22 Thread Nick Sarbicki
On Wed, Jun 22, 2016 at 9:42 AM Miki Tebeka wrote: > IMO you can do that at https://www.codecademy.com/learn/python > Some people might think differently but I wouldn't recommend a python course which teaches 2.7 over 3.x. It bugs me that learnpythonthehardway and codecademy - probably 2 of the

Re: while Loops

2016-06-22 Thread alister
On Tue, 21 Jun 2016 20:50:24 -0700, Elizabeth Weiss wrote: > i=1 while i<=5: >print(i) >i=i+1 > > The result is: > 1 > 2 > 3 > 4 > 5 > > Why is one of the results 5 since i=i+1? Should the maximum result be 4 > since 4 +1=5? > > Thanks for your help! check you loop condition while i le

Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-22 Thread Miki Tebeka
On Tuesday, June 21, 2016 at 2:03:28 PM UTC+3, Pushpanth Gundepalli wrote: > Guys, can you please share me some sites where we can practice python > programs for beginners and Intermediate. IMO you can do that at https://www.codecademy.com/learn/python -- https://mail.python.org/mailman/listinfo

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-22 Thread Lawrence D’Oliveiro
On Wednesday, June 22, 2016 at 7:50:50 AM UTC+12, Tim Chase wrote: > > I have a ~/.XCompose file that contains something like > > include "%L" >: "😖" U1F616 # CONFOUNDED FACE >: "😛" U1F61B # FACE WITH > STUCK-OUT TONGUE: "😛" U1F61B # > FACE WIT

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Lawrence D’Oliveiro
On Wednesday, June 22, 2016 at 3:40:22 PM UTC+12, Elizabeth Weiss wrote: > I am a little confused as to how this is False: > > False==(False or True) > > I would think it is True because False==False is true. > > I think the parenthesis are confusing me. No, it is the meanings of the boolean

Re: Unexpected NANs in complex arithmetic

2016-06-22 Thread Antoon Pardon
Op 22-06-16 om 04:48 schreef Steven D'Aprano: > I'm doing some arithmetic on complex numbers involving INFs, and getting > unexpected NANs. > > py> INF = float('inf') > py> z = INF + 3j > py> z > (inf+3j) > py> -z > (-inf-3j) > > So far, nothing unexpected has occurred. But: > > py> -1*z # should

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Jussi Piitulainen
Christian Gollwitzer writes: > Am 22.06.16 um 05:40 schrieb Elizabeth Weiss: >> I am a little confused as to how this is False: >> >> False==(False or True) >> >> I would think it is True because False==False is true. >> >> I think the parenthesis are confusing me. > > Are you thinking, by any cha

Re: Unexpected NANs in complex arithmetic

2016-06-22 Thread Steven D'Aprano
On Wednesday 22 June 2016 16:58, Steven D'Aprano wrote: > But it makes no sense to me to introduce a NAN into a calculation > just because you multiply by 1, even if it includes an INF. And multiplying > by -1 should be identical to negating. Ah, not one second after I hit send, it struck me -- P

Re: Unexpected NANs in complex arithmetic

2016-06-22 Thread Steven D'Aprano
On Wednesday 22 June 2016 12:57, Chris Angelico wrote: > On Wed, Jun 22, 2016 at 12:48 PM, Steven D'Aprano > wrote: >> I'm doing some arithmetic on complex numbers involving INFs, and getting >> unexpected NANs. >> >> py> INF = float('inf') >> py> z = INF + 3j >> py> z >> (inf+3j) >> py> -z >> (-