Akhil Narayanan Nair home

Python - Function Sum

================

’'’Display any number of sum problems with a function. Handle keyboard input separately. ‘’’

def sumProblem(x, y):

sum = x + y

sentence = 'The sum of {} and {} is {}.'.format(x, y, sum)

print(sentence)

def main():

sumProblem(2, 3)

sumProblem(1234567890123, 535790269358)

a = int(input("Enter an integer: "))

b = int(input("Enter another integer: "))

sumProblem(a, b)

main()