IACS Computes! High School summer camp
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
Day 9
Write a function leap
that determines whether a given year is a normal year or a leap year.
Leap years occur mostly every 4 years, but every 100 years we skip a leap year unless the year is divisible by 400.
False
Next, write a function leap_years
that tells you which years out of the next n
years are going to be leap years.
[2020, 2024, 2028, 2032, 2036]
[2020, 2024, 2028, 2032, 2036, 2040, 2044, 2048, 2052, 2056, 2060, 2064]
Write a function which implements Pascal’s triangle.
[1]
[1, 1]
[1, 2, 1]
[1, 3, 3, 1]
[1, 4, 6, 4, 1]
[1, 5, 10, 10, 5, 1]
[1, 6, 15, 20, 15, 6, 1]
[1, 6, 15, 20, 15, 6, 1]