Q. Consider the following function definitions. Write appropriate function call statements for these.
[Hint: Be careful about which function calls should be part of some expression or statement]
S.No. | Function Definition | Function Call |
---|---|---|
(a) | def sumof3Multiplesi(n): s = n * + 1 + n * 2 + n * 3 return s |
|
(b) | def sumof3Multiples2 (n) : s = n + 1 + n * 2 + n * 3 print(s) |
|
(c) | def areaOfSquare(a) : return a * a |
|
(d) | def areaOfRectangle (a, b) : return a * b |
|
(e) | def perimeterCircle(r): return (2 * 3.1459 * r) |
|
(f) | def perimeterRectangle(l, b) : return 2 * (l + b) |
|
(g) | def Quote(): print("\t Quote of the Day") print("Act Without Expectaton!") print("\t-Lao Tzu") |
|
(h) | def poly(x, y, z): s = x ** 3 + y ** 2 + z return s |
Answer :-
S.No. | Function Definition | Function Call |
---|---|---|
(a) | def sumof3Multiplesi(n): s = n * + 1 + n * 2 + n * 3 return s |
sumof3Multiplesi(n) |
(b) | def sumof3Multiples2 (n) : s = n + 1 + n * 2 + n * 3 print(s) |
sumof3Multiples2 (n) |
(c) | def areaOfSquare(a) : return a * a |
areaOfSquare(a) |
(d) | def areaOfRectangle (a, b) : return a * b |
areaOfRectangle (a, b) |
(e) | def perimeterCircle(r): return (2 * 3.1459 * r) |
perimeterCircle(r) |
(f) | def perimeterRectangle(l, b) : return 2 * (l + b) |
perimeterRectangle(l, b) |
(g) | def Quote(): print("\t Quote of the Day") print("Act Without Expectaton!") print("\t-Lao Tzu") |
Quote() |
(h) | def poly(x, y, z): s = x ** 3 + y ** 2 + z return s |
poly(x, y, z) |
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )