Write the code for a Python function called averageDailyClose that accepts the name of the file to read, the year, and the month (defaults to -1)….

  

Write the code for a Python function called averageDailyClose thataccepts thename of the file to read, the year, and the month (defaults to -1).This function reads through the file and displays the average daily close(field number 2) but only for all records within the month and year suppliedas parameters.If the month supplied is -1, then this function computes and displays the average dailyclose for ALL records within that year.The floating point output must be displayed accurate to 4 decimal placesusing the print( ) function below:print(“{:.4f}”.format(yourFloatValue))Your function MUST use exception handling when accessing the file and capture theIOError exception and display the message: “error opening file… X” (where X is the name of the file).Your solution MUST NOT terminate the program with the exit( ) or any other function!The function prototype MUST be:def averageDailyClose(fileName, year, month = -1) : Computer Science Engineering & Technology Python Programming PRG 550

Don't use plagiarized sources. Get Your Custom Essay on
Write the code for a Python function called averageDailyClose that accepts the name of the file to read, the year, and the month (defaults to -1)….
Just from $13/Page
Order Essay
  

Leave a Reply

Your email address will not be published.

Related Post

are there any theoretical explanations and approaches scholars and policy analysts use to discuss child abuse and welfare What are some knownare there any theoretical explanations and approaches scholars and policy analysts use to discuss child abuse and welfare What are some known

  are there any theoretical explanations and approaches scholars andpolicy analysts use to discuss child abuse and welfare   What are some known explanations or causes of child abuse and welfare Social Science

READ MOREREAD MORE
Open chat
💬 Need help?
Hello 👋
Can we help you?