Answer:
In Python:
import datetime
def find_day(month,day):
days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']
ans = datetime.date(2019, month, day)
ans = ans.strftime("%A")
print(days.index(ans)+1)
Explanation:
This imports datetime module
import datetime
The function is defined here
def find_day(month,day):
This initializes the days of the week as a list
days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']
This gets the day of the week using the datetime module as a date
ans = datetime.date(2019, month, day)
This converts the date as string its respective day of the week
ans = ans.strftime("%A")
This prints the day of the week base on its position in the above defined list
print(days.index(ans)+1)