DateTimeの処理
from datetime import datetime
datetime_1 = '20210321'
datetime_2 = '20210301'
# 文字列からフォーマットを指定してdatetime型へ変換
convert_datetime_1 = datetime.strptime(datetime_1, '%Y%m%d')
convert_datetime_2 = datetime.strptime(datetime_2, '%Y%m%d')
dt = convert_datetime_1 - convert_datetime_2
print(dt.days)
print(type(dt.days)) #int