A pregnancy is dated from the first day of the last menstruation. You will find the expected date of birth, count the weeks and days so far, and name the trimester.
The idea. A full pregnancy lasts days. The trimesters end at the end of week and week in clinical use. Python can add days to a date with timedelta.
Your tasks.
due_date. It gives the date days after the last menstruation.weeks_and_days. It gives a pair: the whole weeks, and the days left over, between the two dates.trimester. It gives up to week , up to week , and after that.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…