{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyPvcUK/oRq1Rsr/3R2dfWJf"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","execution_count":1,"metadata":{"id":"BkcuXqq6tFKE","executionInfo":{"status":"ok","timestamp":1717697243847,"user_tz":-330,"elapsed":40,"user":{"displayName":"Amit Sachan","userId":"17076119069500437280"}}},"outputs":[],"source":["#Example 8: Write a program, which takes user input YEAR and then returns that year is leap year or not a Leap year."]},{"cell_type":"code","source":["# program to check if year is a leap year or not\n","\n","# To get year from the user\n","year = int(input(\"Enter a year: \"))\n","\n","# century year divided by 400 is leap year\n","if (year % 400 == 0):\n","    print(year,\"is a leap year\")\n","\n","# year divided by 4 is a leap year & not divided by 100 means not a century year\n","elif (year % 4 ==0) and (year % 100 != 0):\n","    print(year,\"is a leap year\")\n","else:\n","    print(year,\"is not a leap year\")\n"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"Lv5O0ucRuzhd","executionInfo":{"status":"ok","timestamp":1717697259351,"user_tz":-330,"elapsed":15541,"user":{"displayName":"Amit Sachan","userId":"17076119069500437280"}},"outputId":"1be3f0a0-ce3c-4532-fbd0-7a88e0340e3e"},"execution_count":2,"outputs":[{"output_type":"stream","name":"stdout","text":["Enter a year: 2024\n","2024 is a leap year\n"]}]}]}