Re: Newbie coding question - format error

2014-06-29 Thread Martin S
Thanks for the input. The main thing was that the replacement fields were only valid for their local environment. /martin On 29 Jun 2014, Terry Reedy wrote: >On 6/29/2014 3:06 AM, Martin S wrote: > >A couple of additional notes: > >> x=int(input('Enter an integer ')) >> y=int(input('Enter ano

Re: Newbie coding question - format error

2014-06-29 Thread Martin S
Thanks for the input. The main thing was that On 29 Jun 2014, Terry Reedy wrote: >On 6/29/2014 3:06 AM, Martin S wrote: > >A couple of additional notes: > >> x=int(input('Enter an integer ')) >> y=int(input('Enter another integer ')) >> z=int(input('Enter a third integer ')) >> formatStr='Intege

Re: Newbie coding question - format error

2014-06-29 Thread Terry Reedy
On 6/29/2014 3:06 AM, Martin S wrote: A couple of additional notes: x=int(input('Enter an integer ')) y=int(input('Enter another integer ')) z=int(input('Enter a third integer ')) formatStr='Integer {0}, {1}, {2}, and the sum is {3}.' When the replacement fields and arguments are in the same

Re: Newbie coding question - format error

2014-06-29 Thread Roy Smith
In article , Sibylle Koczian wrote: > Am 29.06.2014 09:06, schrieb Martin S: > > IndexError: tuple index out of range > > > > {0} ... {3} are just placeholders in your format strings, they can't > exist outside of them. And you can't put more placeholders into the > format string than you've

Re: Newbie coding question - format error

2014-06-29 Thread Sibylle Koczian
Am 29.06.2014 09:06, schrieb Martin S: x=int(input('Enter an integer ')) y=int(input('Enter another integer ')) z=int(input('Enter a third integer ')) formatStr='Integer {0}, {1}, {2}, and the sum is {3}.' equations=formatStr.format(x,y,z,x+y+z) print(equations) formatStr2='{0} divided by {1} is

Newbie coding question - format error

2014-06-29 Thread Martin S
Hi again, Still working leisurely through the tutorial here: http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/io.html An excise at the end of second 1.10 says to Write a version of the quotient problem in *Exercise for Quotients*

Re: Newbie coding question

2014-06-26 Thread Chris Angelico
On Fri, Jun 27, 2014 at 4:53 AM, Martin S wrote: > I've been following the tutorial here > http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ Be aware that this tutorial is aimed at Python 3.1, which is a quite old version in the 3.x branch. I recommend you get the latest Python (currently 3.

Re: Newbie coding question

2014-06-26 Thread Emile van Sebille
On 6/26/2014 11:53 AM, Martin S wrote: Hi, I've been following the tutorial here http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ But when I get to section 1.10 there is person = input('Enter your name:') However this generates an error >>> person = input('Enter your name: ') Enter

Re: Newbie coding question

2014-06-26 Thread Martin S
Ah, that was actually correct. Thanks ... /Martin S 2014-06-26 20:58 GMT+02:00 alister : > On Thu, 26 Jun 2014 20:53:35 +0200, Martin S wrote: > > > Hi, > > > > I've been following the tutorial here > > http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ > > But when I get to section 1.10 th

Re: Newbie coding question

2014-06-26 Thread alister
On Thu, 26 Jun 2014 20:53:35 +0200, Martin S wrote: > Hi, > > I've been following the tutorial here > http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ > But when I get to section 1.10 there is > > person = input('Enter your name: ') > > However this generates an error > > person =

Newbie coding question

2014-06-26 Thread Martin S
Hi, I've been following the tutorial here http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ But when I get to section 1.10 there is person = input('Enter your name: ') However this generates an error >>> person = input('Enter your name: ') Enter your name: hi Traceback (most recent call