year=int(input("Please enter a year to be check leap year or not: ")) if(year%4==0 and year%100!=0 or year%400==0): print("This year is a leap year") else: print("This year is not a leap year") Output 1: Please enter a year to be check leap year or not: 2012 This year is a leap year Output 2: Please enter a year to be check leap year or not: 2015 This year is not a leap year
इन्हें भी देखें।
- while loop
- for loop
- nested loops
- loop control statements (Break, Continue, Pass)
- if statement
- if-else statement
- if-elif statement
- nested if statement
- range() function
- keywords
- Identifiers (names)
- Literals
- Operators
- punctuatorts
Python Programs के लिये यहाँ click करें।