Python:根据艾宾浩斯遗忘曲线计算复习日期

前言:最近开始复习考研英语了,每天做阅读记笔记,同时每天需要复习前几天的笔记,考虑到艾宾浩斯遗忘曲线这个东西,便写了一个小脚本来计算每一天记录的笔记需要复习的日期。

函数说明:函数review_time的输入是记笔记的日期,输出就是需要复习这一天笔记的那些天的日期。

函数定义如下:

import datetime
def review_time(today):
    delta_list = [1,1,2,2,3,4,5,5] # 每两天复习的间隔
    review_day = []
    new_day = datetime.datetime.strptime(today, '%m-%d')
    for day in delta_list:
        new_day = datetime.datetime.strptime(new_day.strftime('%m-%d'),'%m-%d') + datetime.timedelta(days=day)
        review_day.append(new_day.strftime('%m.%d'))
    print('today is ', today, 'review days are', review_day)

用法如下:

# 输入
review_time('08-28')
review_time('08-29')
review_time('08-30')

# 输出
today is  08-28 review days are ['08.29', '08.30', '09.01', '09.03', '09.06', '09.10', '09.15', '09.20'] 
today is  08-29 review days are ['08.30', '08.31', '09.02', '09.04', '09.07', '09.11', '09.16', '09.21']
today is  08-30 review days are ['08.31', '09.01', '09.03', '09.05', '09.08', '09.12', '09.17', '09.22']

用法解释:如果我在8.28那一天作了笔记,那么这一天的笔记需要在8.29, 8.30, 9.1, … , 9.20日这几天进行复习,每天过一遍。

补充:复习日期之间间隔时间(天数)可以通过delta_list来进行设定,我这里设定的是[1,1,2,2,3,4,5,5],大家可以自行安排其他间隔时间。

更新
将9月份复习的时间表附在下面,供有需要的同学自取

# 使用如下3行代码可以生成9月份的复习间隔,其他月份同理
ss = '09-'
for i in range(1,30):
    review_time(ss+str(i))
	
# 9月份笔记复习时间表
today is  09-1 review days are ['09.02', '09.03', '09.05', '09.07', '09.10', '09.14', '09.19', '09.24']
today is  09-2 review days are ['09.03', '09.04', '09.06', '09.08', '09.11', '09.15', '09.20', '09.25']
today is  09-3 review days are ['09.04', '09.05', '09.07', '09.09', '09.12', '09.16', '09.21', '09.26']
today is  09-4 review days are ['09.05', '09.06', '09.08', '09.10', '09.13', '09.17', '09.22', '09.27']
today is  09-5 review days are ['09.06', '09.07', '09.09', '09.11', '09.14', '09.18', '09.23', '09.28']
today is  09-6 review days are ['09.07', '09.08', '09.10', '09.12', '09.15', '09.19', '09.24', '09.29']
today is  09-7 review days are ['09.08', '09.09', '09.11', '09.13', '09.16', '09.20', '09.25', '09.30']
today is  09-8 review days are ['09.09', '09.10', '09.12', '09.14', '09.17', '09.21', '09.26', '10.01']
today is  09-9 review days are ['09.10', '09.11', '09.13', '09.15', '09.18', '09.22', '09.27', '10.02']
today is  09-10 review days are ['09.11', '09.12', '09.14', '09.16', '09.19', '09.23', '09.28', '10.03']
today is  09-11 review days are ['09.12', '09.13', '09.15', '09.17', '09.20', '09.24', '09.29', '10.04']
today is  09-12 review days are ['09.13', '09.14', '09.16', '09.18', '09.21', '09.25', '09.30', '10.05']
today is  09-13 review days are ['09.14', '09.15', '09.17', '09.19', '09.22', '09.26', '10.01', '10.06']
today is  09-14 review days are ['09.15', '09.16', '09.18', '09.20', '09.23', '09.27', '10.02', '10.07']
today is  09-15 review days are ['09.16', '09.17', '09.19', '09.21', '09.24', '09.28', '10.03', '10.08']
today is  09-16 review days are ['09.17', '09.18', '09.20', '09.22', '09.25', '09.29', '10.04', '10.09']
today is  09-17 review days are ['09.18', '09.19', '09.21', '09.23', '09.26', '09.30', '10.05', '10.10']
today is  09-18 review days are ['09.19', '09.20', '09.22', '09.24', '09.27', '10.01', '10.06', '10.11']
today is  09-19 review days are ['09.20', '09.21', '09.23', '09.25', '09.28', '10.02', '10.07', '10.12']
today is  09-20 review days are ['09.21', '09.22', '09.24', '09.26', '09.29', '10.03', '10.08', '10.13']
today is  09-21 review days are ['09.22', '09.23', '09.25', '09.27', '09.30', '10.04', '10.09', '10.14']
today is  09-22 review days are ['09.23', '09.24', '09.26', '09.28', '10.01', '10.05', '10.10', '10.15']
today is  09-23 review days are ['09.24', '09.25', '09.27', '09.29', '10.02', '10.06', '10.11', '10.16']
today is  09-24 review days are ['09.25', '09.26', '09.28', '09.30', '10.03', '10.07', '10.12', '10.17']
today is  09-25 review days are ['09.26', '09.27', '09.29', '10.01', '10.04', '10.08', '10.13', '10.18']
today is  09-26 review days are ['09.27', '09.28', '09.30', '10.02', '10.05', '10.09', '10.14', '10.19']
today is  09-27 review days are ['09.28', '09.29', '10.01', '10.03', '10.06', '10.10', '10.15', '10.20']
today is  09-28 review days are ['09.29', '09.30', '10.02', '10.04', '10.07', '10.11', '10.16', '10.21']
today is  09-29 review days are ['09.30', '10.01', '10.03', '10.05', '10.08', '10.12', '10.17', '10.22']


本篇笔记记录完毕,祝考研人都能上岸!

  • 0
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值