Dates with datetime

Lab Python Intermediate 20 points

Read two dates YYYY-MM-DD. Print the number of days between them, the weekday name of the first date, and the date 100 days after the first.

Input

Two lines.

Output

Three lines.

Example

Input

2026-01-01
2026-10-16

Output

288
Thursday
2026-04-11
Sample input available Sample output available
Editor
Python

Hints

Subtracting two dates gives a timedelta with .days.

strftime("%A") gives the weekday name.

Solution explanation

datetime handles leap years and month lengths for you.

Show solution
from datetime import date, timedelta

d1 = date.fromisoformat(input())
d2 = date.fromisoformat(input())
print(abs((d2 - d1).days))
print(d1.strftime("%A"))
print(d1 + timedelta(days=100))
Output
Answer
HOME LEARN COMMUNITY DASHBOARD