Computer Science, asked by kumars1882, 1 year ago

Write a python program to generate the next 15 leap years starting from a given year. Populate the leap years into a list and display the list.Write a python program to generate the next 15 leap years starting from a given year. Populate the leap years into a list and display the list.

Answers

Answered by harshini48
1

Explanation:

hope you will understand

Attachments:
Answered by lovingheart
3

Python program to generate the next 15 leap years starting from a given year:

def find_leap_yrs(given_year):  

cnt=0

list_of_leap_yrs=[]  

while(cnt<15):

if( given_yr%400==0 or given_yr%4==0 and given_yr%100==0):

            list_of_leap_yrs.append(given_year)

cnt=cnt+1  

given_yr=given_yr+1

                return list_of_leap_yrs  

list_of_leap_yrs=find_leap_yrs(2014)

print(list_of_leap_yrs)

Similar questions