Check Leap Year coderinme

Check Leap Year coderinme

Check Leap Year coderinme
1. To determine whether a year is a leap year, follow these steps:
2. If the year is evenly divisible by 4, go to step 2. Otherwise, go to step 5.
3. If the year is evenly divisible by 100, go to step 3. Otherwise, go to step 4.
4. If the year is evenly divisible by 400, go to step 4. Otherwise, go to step 5.
5. The year is a leap year (it has 366 days).
The year is not a leap year (it has 365 days).

#!/usr/bin/env python
yr=int(raw_input("Enter the year: "))
if yr % 4 == 0 and yr % 100 != 0 or yr % 400 == 0:
print yr,' is a Leap Year'
else:
print yr,' is not a Leap Year'

For more programs on Python, visit our Python Coder Archives

Check Leap Year coderinme

All rights reserved. No part of this Post may be copied, distributed, or transmitted in any form or by any means, without the prior written permission of the website admin, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. For permission requests, write to the owner, addressed “Attention: Permissions Coordinator,” to the admin @coderinme

Leave a reply:

Your email address will not be published.