Re: [Tutor] List vs. Set:

2018-02-25 Thread Steven D'Aprano
On Sat, Feb 24, 2018 at 08:00:58PM +, James Lundy wrote: > Could this be a bug in my Pycharm 3 compiler I have had mixed > experiences running the code. As a general rule, any time you get an unexpected error and think "Could this be a bug in the compiler?", the chances are almost always "N

Re: [Tutor] List vs. Set:

2018-02-25 Thread Mark Lawrence
On 24/02/18 20:00, James Lundy wrote: To whom it may concern. This code is from Dr. John Keyser. Please arrange for him to go on a programming course :-) gooddata = [] for singleday in datalist: if (singleday[0] == day) and (singleday[1] == month): Yuck, unneeded brackets disease.

Re: [Tutor] List vs. Set:

2018-02-25 Thread Alan Gauld via Tutor
On 24/02/18 20:00, James Lundy wrote: > To whom it may concern. This code is from Dr. John Keyser. Since you don;t show us the complete program I will have to make some assumptions... > gooddata = [] This is degioned as a list by virtue of the [] > for singleday in datalist: > if (singleday

[Tutor] List vs. Set:

2018-02-25 Thread James Lundy
To whom it may concern. This code is from Dr. John Keyser. gooddata = [] for singleday in datalist: if (singleday[0] == day) and (singleday[1] == month): gooddata.append({singleday[2], singleday[3], singleday[4], singleday[5]}) # Perform analysis minsofar = 120 maxsofar = -100 numg