Add one day X17654


Statement
 

pdf   zip

html

Write a function add_one_day(d, m, y) that receives three positive integers d, m, y corresponding to a valid date of a non-leap year, and returns the date of the following day.

Observations

If you want to test your program locally, remember to include the following lines at the end of the file:

if __name__ == "__main__": import doctest doctest.testmod(verbose=True)
Sample session
>>> add_one_day(12, 3, 2002)
(13, 3, 2002)
>>> add_one_day(30, 6, 1975)
(1, 7, 1975)
>>> add_one_day(28, 2, 2017)
(1, 3, 2017)
>>> add_one_day(15, 6, 1975)[0]
16
Information
Author
ProAl
Language
English
Official solutions
Python
User solutions
Python