Computer Science
Write a program to take year as input and check if it is a leap year or not.
Python
Python Data Handling
46 Likes
Answer
y = int(input("Enter year to check: "))
print(y % 4 and "Not a Leap Year" or "Leap Year")
Output
Enter year to check: 2020
Leap Year
Answered By
25 Likes
Related Questions
Write a program that reads a number of seconds and prints it in form : mins and seconds, e.g., 200 seconds are printed as 3 mins and 20 seconds.
[Hint. use // and % to get minutes and seconds]Write a program to take two numbers and print if the first number is fully divisible by second number or not.
Write a program to take a 2-digit number and then print the reversed number. That is, if the input given is 25, the program should print 52.
Write a program to obtain x, y, z from user and calculate expression : 4x4 + 3y3 + 9z + 6π