[Tutor] python coding problem

Richard Koeman rkoeman at smcdsb.on.ca
Mon Sep 26 11:35:32 EDT 2016


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 nothing else
happens.

def maximum(n1, n2):
  print "the first number is" ,n1
  print "the second number is", n2
  if n1 > n2:
    return
    print n1 , "is the bigger number"
  elif n1 < n2:
    return n2
    print n2
  elif n1 == n2:
    print "they are equal"
  else:
    print "Sorry, No response found"
maximum(1,2)

-- 
This is a staff email account managed by Simcoe Muskoka Catholic District 
School Board.  This email and any files transmitted with it are 
confidential and intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this email in error please 
notify the sender.


More information about the Tutor mailing list