1. sum of the exponentials of the values in the list in python

User Generated

Ecenirra

Programming

python COURSE

American College of California

Description

sum of exponentials in python, values given in sheet please look at atteched sheet.

Unformatted Attachment Preview

1. Write a method that takes argument a list (of any length) and returns the sum of the exponentials of the values in the list. For example: myList = [0.1, 0.9, -1.2] The method should find 𝑒 0.1 + 𝑒 0.9 + 𝑒 −1.2 and return the value3.865 Note: in python to find e0.1, you would do the following: import math math.exp(0.1) Write your program and demonstrate it with the above example. Take a screen shot of your implementation with along with the output for the example list above and upload your solution on Canvas. The partial implementation of the method is shown below along with some suggestions: import math expsumVal = #What will you initialize it to? def myExpSum(myList): #your for loop comes here #Your summing comes here.Note, as mentioned before, #to find exponential #use math.exp(x), where x is the variable in the for #loop #put your return here
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

notify me ...


Anonymous
Great! 10/10 would recommend using Studypool to help you study.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags