Re: [Tutor] Function not returning 05 as string [SOLVED]

2015-04-13 Thread Ken G.
On 04/13/2015 08:56 AM, Steven D'Aprano wrote: On Mon, Apr 13, 2015 at 08:11:46AM -0400, Ken G. wrote: I am sure there is an simple explanation but when I input 5 (as integer), resulting in 05 (as string), I get zero as the end result. When running the code: number01 = 0 Here you set the vari

Re: [Tutor] Function not returning 05 as string

2015-04-13 Thread Steven D'Aprano
On Mon, Apr 13, 2015 at 08:11:46AM -0400, Ken G. wrote: > I am sure there is an simple explanation but when I input > 5 (as integer), resulting in 05 (as string), I get zero as the end > result. When running the code: > number01 = 0 Here you set the variable "number01" to the int 0. > numberentr

Re: [Tutor] Function not returning 05 as string

2015-04-13 Thread David Palao
Hello, In the code that you posted, as it is, you are: 1) defining a function (numberentry) 2) defining a global variable (number01) and setting it to 0 3) calling numberentry discarding the result 4) printing the value of the global variable number01 I would guess that you want to store the resul

Re: [Tutor] Function not returning 05 as string

2015-04-13 Thread Peter Otten
Ken G. wrote: > I am sure there is an simple explanation but when I input > 5 (as integer), resulting in 05 (as string), I get zero as the end > result. When running the code: > > START OF PROGRAM: > Enter the 1st number: 5 > > 05 > > 0 > END OF PROGRAM: > > START OF CODE: > import sys > > d

Re: [Tutor] Function not returning 05 as string

2015-04-13 Thread Ken G.
On 04/13/2015 08:18 AM, Dave Angel wrote: On 04/13/2015 08:11 AM, Ken G. wrote: I am sure there is an simple explanation but when I input 5 (as integer), resulting in 05 (as string), I get zero as the end result. When running the code: START OF PROGRAM: Enter the 1st number: 5 05 0 END OF

Re: [Tutor] Function not returning 05 as string

2015-04-13 Thread Dave Angel
On 04/13/2015 08:11 AM, Ken G. wrote: I am sure there is an simple explanation but when I input 5 (as integer), resulting in 05 (as string), I get zero as the end result. When running the code: START OF PROGRAM: Enter the 1st number: 5 05 0 END OF PROGRAM: START OF CODE: import sys def numb

[Tutor] Function not returning 05 as string

2015-04-13 Thread Ken G.
I am sure there is an simple explanation but when I input 5 (as integer), resulting in 05 (as string), I get zero as the end result. When running the code: START OF PROGRAM: Enter the 1st number: 5 05 0 END OF PROGRAM: START OF CODE: import sys def numberentry(): print number01 = raw