Re: [Tutor] solution for for loop?

2014-10-25 Thread Clayton Kirkwood
Ding, ding, ding. Winner, winner, winner. Peter wins the prize, suggesting the use of zip(). This allowed me to pull two different strings from two different lists at one time in a for loop. for description_position, code_position in zip(description, code): Yes!! Thank you Peter Clayton !-

Re: [Tutor] Code critique

2014-10-25 Thread Crush
Thank you Peter for your example. I have the code working now and will post soon for eveyones benefit. Thank you all who took the time to help. Bo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.pyt

Re: [Tutor] Help with running an API

2014-10-25 Thread Joel Goldstick
On Sat, Oct 25, 2014 at 12:08 PM, Mark Meanwell wrote: > Hi Folks - new to python and trying to run an API. Running version 2.7.3. on > Windows 7 machine. > > Here is the scenario for the given API (FRED API in this case): > > easy_install Fred from C:\ - this installs to C:\site packages > > the

Re: [Tutor] Help with running an API

2014-10-25 Thread Alan Gauld
On 25/10/14 17:08, Mark Meanwell wrote: Hi Folks - new to python and trying to run an API. Running version 2.7.3. on Windows 7 machine. Here is the scenario for the given API (FRED API in this case): easy_install Fred from C:\ - this installs to C:\site packages then I fire up the python she

[Tutor] Help with running an API

2014-10-25 Thread Mark Meanwell
Hi Folks - new to python and trying to run an API. Running version 2.7.3. on Windows 7 machine. Here is the scenario for the given API (FRED API in this case): easy_install Fred from C:\ - this installs to C:\site packages then I fire up the python shell and run file created for fred api: from

Re: [Tutor] solution for for loop?

2014-10-25 Thread Alan Gauld
On 25/10/14 04:17, Clayton Kirkwood wrote: description_string=code_string='' description = code = ‘a’ for (description_position, code_position) in (description, code): print(description_position,code_position) I have tried variations on this for statement, and it doesn’t work:<))) No sur

Re: [Tutor] solution for for loop?

2014-10-25 Thread Peter Otten
Clayton Kirkwood wrote: > description_string=code_string='' > > description = code = 'a' > > for (description_position, code_position) in (description, code): > > print(description_position,code_position) > I have tried variations on this for statement, and it doesn't work:<))) > Both desc

[Tutor] solution for for loop?

2014-10-25 Thread Clayton Kirkwood
description_string=code_string='' description = code = 'a' for (description_position, code_position) in (description, code): print(description_position,code_position) I have tried variations on this for statement, and it doesn't work:<))) Both description and code have the same size arra

Re: [Tutor] Is there a convenient table of Python 3.4 exceptions?

2014-10-25 Thread Alan Gauld
On 25/10/14 03:14, boB Stepp wrote: In the programs I have been dabbling in at work, I am often "surprised" by the situations my users stumble into that I did not have sufficient imagination to consider up front. That's always a problem. And just when you think you've seen everything the user

Re: [Tutor] Code critique

2014-10-25 Thread Peter Otten
Bo Morris wrote: > Thank you all for the helpful criticism. I wish I was able to catch on to > what you are suggesting more quickly. > > Based on your recommendations, I have come up with the following so far, > however I just dont see it as easily as I did while using the if/elif > statements. >