Saved Bookmarks
| 1. |
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. |
|
Answer» 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) |
|