Re: [Tutor] Odd result from function call

2011-01-07 Thread Alan Gauld
"Ben Ganzfried" wrote x = input("First x is: ") y = input("First y is: ") input() reads strings compare(x,y) the character '1' is less than the character '5' so far as Python is concerned When I do simply compare(10, 5) from the shell, You are using integers. What happens if you u

Re: [Tutor] Odd result from function call

2011-01-07 Thread Alex Hall
Cast to an int: x=int(x) See if that helps. On 1/7/11, Ben Ganzfried wrote: > When I call one of my functions from the shell (ie compare(10, 5)) it > produces the correct output. However, when I run the program after calling > the method later in the script, the result is bizarre. I'm curious w

Re: [Tutor] Odd result from function call

2011-01-07 Thread Vince Spicer
On Fri, Jan 7, 2011 at 11:38 AM, Ben Ganzfried wrote: > When I call one of my functions from the shell (ie compare(10, 5)) it > produces the correct output. However, when I run the program after calling > the method later in the script, the result is bizarre. I'm curious why the > wrong result i