Re: None shown in output

2012-06-21 Thread Xander Solis
Thanks for replying still! Appreciate the help. On Fri, Jun 22, 2012 at 12:25 PM, Benjamin Kaplan wrote: > damn > > On Thu, Jun 21, 2012 at 9:24 PM, Benjamin Kaplan > wrote: > > On Thu, Jun 21, 2012 at 8:42 PM, Xander Solis wrote: > >> Hello Python list, > >> > >> Noob here with a newbie questi

Re: None shown in output

2012-06-21 Thread Terry Reedy
On 6/21/2012 11:42 PM, Xander Solis wrote: Hello Python list, Noob here with a newbie question. I'm reading and working on the exercise of the book, Learn Python the Hard way 2.0. When I use this code, I get "None" on the output. My question is why does this happen? None is the default return

Re: None shown in output

2012-06-21 Thread Xander Solis
Thanks Andrew and Michael!. That did the trick. def get_numbers(first_num, second_num, operator): if operator == 'add': value = first_num + second_num elif operator == 'minus': value = first_num - second_num elif operator == 'divide': value = first_num / second

Re: None shown in output

2012-06-21 Thread Benjamin Kaplan
damn On Thu, Jun 21, 2012 at 9:24 PM, Benjamin Kaplan wrote: > On Thu, Jun 21, 2012 at 8:42 PM, Xander Solis wrote: >> Hello Python list, >> >> Noob here with a newbie question. I'm reading and working on the exercise of >> the book, Learn Python the Hard way 2.0. When I use this code, I get "No

Re: None shown in output

2012-06-21 Thread Dan Sommers
On Fri, 22 Jun 2012 11:42:28 +0800 Xander Solis wrote: > Noob here with a newbie question. I'm reading and working on the > exercise of the book, Learn Python the Hard way 2.0. When I use this > code, I get "None" on the output. My question is why does this happen? > > def get_numbers(first_num,

Re: None shown in output

2012-06-21 Thread Benjamin Kaplan
On Thu, Jun 21, 2012 at 8:42 PM, Xander Solis wrote: > Hello Python list, > > Noob here with a newbie question. I'm reading and working on the exercise of > the book, Learn Python the Hard way 2.0. When I use this code, I get "None" > on the output. My question is why does this happen? > > def get

Re: None shown in output

2012-06-21 Thread Andrew Berg
On 6/21/2012 10:42 PM, Xander Solis wrote: > Hello Python list, > > Noob here with a newbie question. I'm reading and working on the > exercise of the book, Learn Python the Hard way 2.0. When I use this > code, I get "None" on the output. My question is why does this happen? Your function prints

Re: None shown in output

2012-06-21 Thread Michael Hrivnak
The last three lines print the return value from the "get_numbers" function, which isn't returning anything. In python, the default return value is None, and that's why you're seeing it. Michael On Thu, Jun 21, 2012 at 11:42 PM, Xander Solis wrote: > Hello Python list, > > Noob here with a newb

None shown in output

2012-06-21 Thread Xander Solis
Hello Python list, Noob here with a newbie question. I'm reading and working on the exercise of the book, Learn Python the Hard way 2.0. When I use this code, I get "None" on the output. My question is why does this happen? def get_numbers(first_num, second_num, operator): if operator == 'ad