Assignment
University
University of ReginaCourse
Computer Science (UR)Pages
1
Academic year
2023
priyankavaiya07
Views
0
p {margin: 0; padding: 0;} .ft00{font-size:23px;font-family:Calibri-Light;color:#000000;} .ft01{font-size:16px;font-family:Calibri;color:#000000;} .ft02{font-size:23px;line-height:31px;font-family:Calibri-Light;color:#000000;} 15. A year is a leap year if it is divisible by 4, except that years divisible by 100 are not leap years unless they are also divisible by 400. Ask the user to enter a year, and, using the // operator, determine how many leap years there have been between 1600 and that year. year=int(input("Enter the year here: ")) if year%4==0 or year%100!=0 and year%400==0: print("It is leap year") else: print("not")
Counting Leap Years between 1600 and a Given Year in Python
Please or to post comments