Question: In this exercise, we added the numbers 1 through 5 . Create a main function that simply has two function calls: one called add _

In this exercise, we added the numbers 1 through 5. Create a main function that simply has two function calls: one called add_first_5, and the other called add_first_10. Write and call a function to add the first 5 numbers and a second function to add the first 10 numbers.
Show the output of the code below
num =1
total =0
while num <=5:
total = total + num
num = num +1
print("Total is: ", total)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!