Question: [4 marks] In this question you will use Python datetime. You may use this webpage as a reference: https://www.w3schools.com/python/python_datetime.asp. To see how to format your

[4 marks] In this question you will use Python datetime. You may use this webpage as a reference: https://www.w3schools.com/python/python_datetime.asp. To see how to format your output string, use this reference:https://www.w3schools.com/python/python_string_formatting.asp.

Write a function date(,,) that takes 3 integer arguments and returns the day of the week and the month, formatted as in the example below. Save your function in a file q1.py. Below is an example output. This was done by opening the interpreter in the directory containing q1.py and then typing the following:

>>> from q1 import * >>> date(2020,8,13) That is a Thursday in the month of August. >>> date(1920,9,20) That is a Monday in the month of September.

You may change the wording if you like, but you must use the .format() function (or some other inline String formatting command) to print Strings.

Here is a bit of code to demonstrate what we are looking for and to get you started. Your file should look like this:

import datetime def date(year, month, day):

date = datetime.datetime(year, month, day)

 # this print is for test purposes only 

print(date) # replace the line above with your code

# The following line is a test case.

# You may include test cases if you wish. # But for your submission we # only require the file containing the function

date(1988, 10, 31) 

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!