See the pdf attached

1 answer below »
See the pdf attached
Answered 3 days AfterJan 02, 2021ITC558Charles Sturt University

Answer To: See the pdf attached

Sumit answered on Jan 05 2021
143 Votes
monthcalc.py
from datetime import date
import sys
def twelve_month_apart(date1,date2):
try:
d1=date.fromisoformat(date1)
d2=date.fromisoformat(date2)
except ValueError:
print('ERROR: Invalid date or incorrect date format. Provide valid dates in YYYY-MM-DD fomat e.g. 2019-04-30.')
sys.exit(-1)
if d1>d2:
print('ERROR: Second date should be same or later than first date.')
sys.exit(-1)
if d2.month==2 and d2.day==29:
d2 = d2.replace(day=28)
d2_prev_year=d2.replace(year = d2.year-1)
return True if d2_prev_year>=d1 else False
# example
# print(twelve_month_apart('2001-02-28', '2002-02-
27'))
solution.drawio
7Vrbdps4FP2arKYP7eJmbB5jJ02n9yYzk+mTlwwy1kQgRogY9+tH4mIQwpc4hrRJHuKggyTg7LP3OSCdmJMgvaQgWnwmHsQnhualJ+b5iWHomjni/4RllVsGIy03+BR5RafKcI1+wnJkYU2QB2OpIyMEMxTJRpeEIXSZZAOUkqXcbU6wfNUI+FAxXLsAq9Yb5LFFbh0Zw8r+HiJ/UV5Zt538TADKzsWTxAvgkWXNZF6cmBNKCMuPgnQCsXBe6ZebP1Y3+NOtffnhe/wf+Gv88c8vf7/JJ3t3nyHrR6AwZAdP/SFFweT682Rg/ZjfOehL7K5m5dQxW5X+gh53X9EklC2IT0KALyrrmJIk9KCYVeOtf5MgKlC3eLMa8omQiBt10Qcytio6gYQRblqwABdnYYrYP2K2t4Oi9aN25jwtLpQ1VkVjT4+Uj0cS6sIt/cy8n3j2WtQUfryEJICMrngHCjFg6E4OLVBEqL/utx76jSB+f4ZWsMnUxDNmgwo26aYmT8IA9SErxlVonlEKVrVukegQH3Kld4eO4Af5XZStmmcqUxZ094jtwvN3ACeFVwOAQiUqq5gTcbFcIAavI5BhuuS6JQfUnISsiDadO2jsYxDHReDEjJLbtRKI3mta3z+u7iBlMN0aMcVZw2p6d1gAv6xESS+VZlET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AMNzp8dHXAfpLn/mY5dHGcO+MBv9cmPKx/kB4faQY3n9OGW55//pY3ploYr2NgV43trtzzr4D25JZA+B3LLNjraLe6xAltI3h65xCu1jVz9GfEui24jTZc7UO+PuzWGtqcO7Mn3X/u153L+APZlf2ZTDF9C/ynPkttwScFFOj3ob7gl9kZiUF9it4ckk0i7SxUTaQM95L1tDYn+AAdX+WpPA5SDaQ4QOM875zgdUZga6OEgdlOYPPc8QGUaFdKgHh2TdBdH8oy5Mf6hCcU/Q4x/stINSBb/FI5zt2xayhqP+Uwtlyly68ZMRnmEayi/PAwlBc8NEyewtowUuoyijdsfhO1vZRLf9MXE/scv9sYkhx3GlK8EVN0ZUNeP1Ce8xz8=
solution.py
# Importing Libraries
import math
import turtle
import monthcalc
# Function to draw a bar on the axes drawn using turtle
def draw_bar(ttl, middle_x, bottom_y, width, height):
# Set the fiil color
ttl.fillcolor('light blue')
# Goto the starting point of the bar
ttl.goto(middle_x,bottom_y)
# Begin filling
ttl.begin_fill()
# Turn left 90 degrees
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here