Skip to content

Commit 94cd9f8

Browse files
author
gsp
committed
1 parent e96c2dd commit 94cd9f8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

days/01-03-datetimes/byte67/byte67.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#! env python
2+
from datetime import datetime, timedelta, date
3+
4+
print(
5+
'Problem 1: We kicked off our 100 Days of Code project on March 30th, 2017. Calculate what date we finished the full 100 days!')
6+
print('Solution:')
7+
kicked_off_date = datetime(2017, 3, 30)
8+
delta = timedelta(days=100)
9+
finish_date = kicked_off_date + delta
10+
print(f'Code project started on {kicked_off_date.date()} finalizing 100 days later on: {finish_date.date()}')
11+
12+
print(
13+
"Problem 2: 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?")
14+
print('Solution:')
15+
16+
foundation_date = datetime(2016,12,19)
17+
first_pycon = datetime(2018,5,8)
18+
delta_days = first_pycon - foundation_date
19+
print(f'{delta_days.days} days')

0 commit comments

Comments
 (0)