Hello,
I am trying to figure out what went wrong with my code for the day 2 challenge. I am pretty sure the result is correct.
Which for challenge one is 2017. 07.08 and 505 days for challenge 2.
Challenge :
- We kicked off our 100 Days of Code project on March 30th, 2017. Calculate what date we finished the full 100 days!
- PyBites was founded on the 19th of December 2016. We're attending our first PyCon together on May 8th, 2018. Can you calculate how many days from PyBites' inception to our first PyCon meet up?
My code :
from datetime import date, timedelta
start_100days = date(2017, 3, 30)
pybites_founded = date(2016, 12, 19)
pycon_date = date(2018, 5, 8)
def get_hundred_days_end_date():
"""Return a string of yyyy-mm-dd"""
end_date=timedelta(days=100)
finish_day = start_100days + end_date
def get_days_between_pb_start_first_joint_pycon():
"""Return the int number of days"""
in_between_days = pycon_date - pybites_founded
print(str(in_between_days))
get_hundred_days_end_date()
get_days_between_pb_start_first_joint_pycon()
error return :
============================= test session starts ==============================
platform linux -- Python 3.8.13, pytest-5.4.2, py-1.8.1, pluggy-0.13.1
rootdir: /tmp
plugins: asyncio-0.12.0
2017-07-08
505 days, 0:00:00
collected 2 items
../../tmp/test_calc_dts.py 2017-07-08
F505 days, 0:00:00
F
=================================== FAILURES ===================================
________________________ test_get_hundred_days_end_date ________________________
def test_get_hundred_days_end_date():
assert get_hundred_days_end_date() == '2017-07-08'
E AssertionError: assert None == '2017-07-08'
E + where None = get_hundred_days_end_date()
/tmp/test_calc_dts.py:6: AssertionError
_______________________ test_get_days_till_pycon_meetup ________________________
def test_get_days_till_pycon_meetup():
assert get_days_between_pb_start_first_joint_pycon() == 505
E assert None == 505
E + where None = get_days_between_pb_start_first_joint_pycon()
/tmp/test_calc_dts.py:10: AssertionError
=========================== short test summary info ============================
FAILED ../../tmp/test_calc_dts.py::test_get_hundred_days_end_date - Assertion...
FAILED ../../tmp/test_calc_dts.py::test_get_days_till_pycon_meetup - assert N...
============================== 2 failed in 0.07s ===============================