Re: [Tutor] python coding problem

2016-09-26 Thread Ben Finney
Alex Hall writes: > On Mon, Sep 26, 2016 at 11:35 AM, Richard Koeman > wrote: > > > def maximum(n1, n2): > > print "the first number is" ,n1 > > print "the second number is", n2 > > if n1 > n2: > > return > > Using the 'return' keyword will return whatever follows it (nothing, in > thi

Re: [Tutor] python coding problem

2016-09-26 Thread Ramanathan Muthaiah
> > This is my first time using this so I hope it works. > I am trying to find out why this code doesnt work. > Its simple. I want to find out which number is bigger. > Welcome! > > I hope you can help and that I am using this python feature properly. > Thanks. > The function prints the first t

Re: [Tutor] python coding problem

2016-09-26 Thread Alex Hall
On Mon, Sep 26, 2016 at 11:35 AM, Richard Koeman wrote: > This is my first time using this so I hope it works. > I am trying to find out why this code doesnt work. > Its simple. I want to find out which number is bigger. > > I hope you can help and that I am using this python feature properly. >

Re: [Tutor] python coding problem

2016-09-26 Thread Alan Gauld via Tutor
On 26/09/16 16:35, Richard Koeman wrote: > The function prints the first two print statements then nothing else > happens. > > def maximum(n1, n2): > print "the first number is" ,n1 > print "the second number is", n2 We know this works so far, so that's fine. > if n1 > n2: > return B

Re: [Tutor] python coding problem

2016-09-26 Thread Danny Yoo
Hi Richard, The "return" statement does an early escape out of the currently running function. You have a "return" statement in your program that looks unintentional. In an ideal world, the Python compiler would give a warning about this because it's a common mistake. Unfortunately it looks lik

[Tutor] python coding problem

2016-09-26 Thread Richard Koeman
This is my first time using this so I hope it works. I am trying to find out why this code doesnt work. Its simple. I want to find out which number is bigger. I hope you can help and that I am using this python feature properly. Thanks. The function prints the first two print statements then noth