Question: I use the python language Read in the contents of the file SP500.txt which has monthly data for 2016 and 2017 about the S&P 500

I use the python languageI use the python language Read in the contents of the fileSP500.txt which has monthly data for 2016 and 2017 about the S&P500 closing prices as well as some other financial indicators, including the

Read in the contents of the file SP500.txt which has monthly data for 2016 and 2017 about the S&P 500 closing prices as well as some other financial indicators, including the Long Term Interest Rate, which is interest rate paid on 10-year U.S. government bonds. Write a program that computes the average closing price (the second column, labeled SP500) and the highest long-term interest rate. Both should be computed only for the period from June 2016 through May 2017. Save the results in the variables mean_SP and max_interest. Save & Run Original - 1 of 1 Show CodeLens Write the data in variable artist_songs into a csv file, 'songs.txt' , where the first column is singer name and second column is a song name. Each line should have a singer and a song name. Use "Name" and "Song " as headers. Do not include double quotation marks (") in your CSV but you should include apostrophes where necessary (for example, for the song "We Don't Talk Anymore"). Save & Run Original - 1 of 1 Show CodeLens UW NA 1 artist_songs = { 'Taylor Swift': ['Love Story', 'You need to Calm Down'], 'Charlie Puth': ['Attention', "We Don't Talk Anymore", 'Change'] You will need to write two functions for this problem. The first function, divide that takes in any number and returns that same number divided by 2. The second function called sum should take any number, divide it by 2, and add 6. It should return this new number. You should call the divide function within the sum function. Do not worry about decimals. Save & Run Original - 1 of 1 Show CodeLens Read in the contents of the file SP500.txt which has monthly data for 2016 and 2017 about the S&P 500 closing prices as well as some other financial indicators, including the Long Term Interest Rate, which is interest rate paid on 10-year U.S. government bonds. Write a program that computes the average closing price (the second column, labeled SP500) and the highest long-term interest rate. Both should be computed only for the period from June 2016 through May 2017. Save the results in the variables mean_SP and max_interest. Save & Run Original - 1 of 1 Show CodeLens Write the data in variable artist_songs into a csv file, 'songs.txt' , where the first column is singer name and second column is a song name. Each line should have a singer and a song name. Use "Name" and "Song " as headers. Do not include double quotation marks (") in your CSV but you should include apostrophes where necessary (for example, for the song "We Don't Talk Anymore"). Save & Run Original - 1 of 1 Show CodeLens UW NA 1 artist_songs = { 'Taylor Swift': ['Love Story', 'You need to Calm Down'], 'Charlie Puth': ['Attention', "We Don't Talk Anymore", 'Change'] You will need to write two functions for this problem. The first function, divide that takes in any number and returns that same number divided by 2. The second function called sum should take any number, divide it by 2, and add 6. It should return this new number. You should call the divide function within the sum function. Do not worry about decimals. Save & Run Original - 1 of 1 Show CodeLens

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!