Skip to content

Instantly share code, notes, and snippets.

@afaqk9394
Created March 5, 2020 01:22
Show Gist options
  • Save afaqk9394/cf6394722172e57c50a2c803be1af6bc to your computer and use it in GitHub Desktop.
Save afaqk9394/cf6394722172e57c50a2c803be1af6bc to your computer and use it in GitHub Desktop.
#Pythoncode1.py (11 lines)
from datetime import date
def diff_dates(date1, date2):
return abs(date2-date1).days
def main():
d1 = date(2013,1,1)
d2 = date(2013,9,13)
result1 = diff_dates(d2, d1)
print '{} days between {} and {}'.format(result1, d1, d2)
print ("You just got one step closer to passing the Cisco DevNet Associate Exam!")
#Pythoncode2.py (8 lines)
def diff_dates(date1, date2):
return abs(date2-date1).days
def main():
d1 = date(2013,1,1)
d2 = date(2013,9,13)
result1 = diff_dates(d2, d1)
print '{} days between {} and {}'.format(result1, d1, d2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment