define/write/complete the function totalMSquare(m),
NumberFun.py # using multiple functions. # copy/paste this program to run it first, you are supposed to use Google Chrome as Internet Browser for this course.
# 1. calculate sum of the first n natural odd numbers, e.g.:1,3,5,7,9... def totalN(n): totalN = 0 for i in range(1,2*n+1,2): totalN = totalN + i return totalN
# 2. calculate sum of the square of the first m natural odd numbers, e.g.:1,9,25,49,81... ### After you define/write/complete the function totalMSquare(m), remove the # sign as below to ENABLE next line of code #def totalMSquare(m):
### YOUR TURN TO DEFINE/WRITE/COMPLETE function totalMSquare(m) as below, based on totalN(n)
2. Don't delete the statements/codes/comments for this program, but just add more statements for the second function. (if deleted, points will be deducted.)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images