Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is python 2 question def is_leap year (year) : input: a year output: True if it is a leap year False otherwise ####################### #

This is python 2 question

image text in transcribed

def is_leap year (year) : input: a year output: True if it is a leap year False otherwise ####################### # Fill your code here, use as many new lines you like. Delete this l # keep the indent! return True # you can delete/change this line and write new if name == " main ": print("Please enter a year") s = raw_input() try: a = int(s) if is_leap_year (a): print("This is a leap year") else: print("this is not a leap year") except: print ("Not an integer") Expected outcome: >> python q3.py Please enter a year >> 2019 this is not a leap year >> >> python 93.py Please enter a year >> 2000 this is not a leap year >> python q3.py Please enter a year >> 2020 This is a leap year

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions