subject
Engineering, 26.02.2020 02:08 abbygreen

Q3: Summation Write a recursive implementation of summation, which takes a positive integer n and a function term. It applies term to every number from 1 to n including n and returns the sum of the results. # Question 3 def summation(n, term) : ""Return the sum of the first n terms in the sequence defined by term. Implement using recursion! >>> summation(5, lambda x: x * x * x) # 1^3 + 2^3 + 3^3 + 4^3 + 5^3 225 >>> summation(9, lambda x: x + 1) # 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 54 >>> summation(5, lambda x: 2**x) # 241 + 2^2 + 2^3 + 2^4 + 245 62 >>> # Do not use while for loops!

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Steel is coated with a thin layer of ceramic to protect against corrosion. what do you expect to happen to the coating when the temperature of the steel is increased significantly? explain.
Answers: 1
question
Engineering, 04.07.2019 18:10
Refrigerant 134a enters an insulated compressor operating at steady state as saturated vapor at -26°c with a volumetric flow rate of 0.18 m3/s. refrigerant exits at 9 bar, 70°c. changes in kinetic and potential energy from inlet to exit can be ignored. determine the volumetric flow rate at the exit, in m3/s, and the compressor power, in kw.
Answers: 1
question
Engineering, 04.07.2019 18:20
Refrigerant-134a enters the compressor of a refrigerator as superheated vapor at 0.14 mpa and -10°c at a rate of 0.05 ka/s and leaves at 0.8 mpa and 50°c. the refrigerant is cooied in the condenser to 0.72 mpa and 26'c. it is then throttled to 0.15 mpa. sketch the t-s diagram for the system and evaluate: 6) the rate of heat removai from the refrigerated space (kw), it) the power input to the compressor (kw), ii) the isentropic efficiency of the compressor (%), and iv) the cop of the refrigerator.
Answers: 2
question
Engineering, 04.07.2019 18:20
Aheavily insulated piston-cylinder device contains 0.02 m3 of steam at 300 kpa and 200 °c. 1.2 mpa. d this process. team is now compressed in a reversible manner to a pressure of etermine the entropy change and the work done on the steam during this process
Answers: 1
You know the right answer?
Q3: Summation Write a recursive implementation of summation, which takes a positive integer n and a...
Questions
question
English, 29.10.2020 18:30
question
English, 29.10.2020 18:30
question
Mathematics, 29.10.2020 18:30
Questions on the website: 13722360