Computer Science, asked by kripa1048, 8 months ago

a)Write a python program to take year as input and check if it is a leap year or not. b)Write a python program to take a two digit number and then print the reversed number.

Answers

Answered by Swetha03K
1

I have no idea why my code got deleted, like bruh how can u copy codes?? It all works the same way.

Anyway

a)

y=int(input("Enter year:")

if ((y%400 == 0) or (( y%4 == 0 ) and ( year%100 != 0))):

     print(y,"is a leap year")

else:

     print(y,"is not a leap year")

b)

n=int(input("Enter number: "))

rev=0

while(n>0):

   dig=n%10

   rev=rev*10+dig

   n=n//10

print("Reverse of the number:",rev)

Similar questions