forked from cclauss/Ten-lines-or-less
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdaze_left.py
27 lines (19 loc) · 899 Bytes
/
daze_left.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python3
# Inspired by https://pythonclock.org
from datetime import date, timedelta
print((date(2020, 1, 1) - date.today()).days, "days until Python 2 end of life.")
def daze_left(days=100):
d = date(2020, 1, 1) - timedelta(days=days)
return f"On {d} there will be {days} days until Python 2 end of life."
for days in (100, 75, 50, 25):
print(daze_left(days=days))
"""
627 days until Python 2 end of life.
On 2018-05-11 there will be 600 days until Python 2 end of life.
On 2018-08-19 there will be 500 days until Python 2 end of life.
On 2018-11-27 there will be 400 days until Python 2 end of life.
On 2019-03-07 there will be 300 days until Python 2 end of life.
On 2019-04-26 there will be 250 days until Python 2 end of life.
On 2019-06-15 there will be 200 days until Python 2 end of life.
On 2019-09-23 there will be 100 days until Python 2 end of life.
"""