Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

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.


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 e^0.1+e^0.9+e^(-1.2) and return the value 1.812

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

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"