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
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
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
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
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,
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
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
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
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