MENU
Question -

Create a function addNumbers(start, end) that adds all the integers between the start and end value (inclusive) and returns the total sum.



Answer -

def addNumbers(start, end):
total = 0
i = start
while start < = end:
total + = start
start + = 1
return total

Comment(S)

Show all Coment

Leave a Comment

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