MENU
Question -

Define a function ‘Subtract Number (x, y)’ which takes in two numbers and returns the different of the two.



Answer -

# Python function which returns the difference of two numbers
> > > a = input (“Enter the first number :”)
> > > b = input (“Enter the second number :”) def Subtract Number (a, b):
> > > print “Subtraction = %d – %d” % (a, b)
> > > return a – b

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×