Days in a Month

Published by Matt in

Create a function that takes the month and year (as integers) and returns the number of days in that month.

Examples

day_amount(2, 2018) ➞ 28

day_amount(4, 654) ➞ 30

day_amount(2, 200) ➞ 28

day_amount(2, 1000) ➞ 28

Notes

Don't forget about leap years!

Watch a quick demo on how Edabit works.