Loading topic
date and timedelta types from the datetime module. By the end you will be able to explain why each habit's check-ins are stored as a set of calen6 min readcurrent_streak, explains why it counts back from a particular day, and covers the errors that show up7 min readlongest_streak, explains why it works, and covers the inputs that can break it.7 min readdate and timedelta from the datetime module and can read and write text files. You should also have the log structure from the earlier chapters: a dictionary that maps each habit7 min readpython habit.py check read instead of editing code. The tool has two commands, check and `show5 min readcheck_in, current_streak, longest_streak and completion_rate. They work on a normal week. This chapter covers the inputs that break a tracker: a check-in logged twice, a day that isn't over yet, a missed day, and dates that arrive in the wrong shape.7 min readdate and timedelta types from datetime. You should also have check_in, current_streak, longest_streak and completion_rate working. H6 min read