File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 55# print("Sum of given two numbers :", num1 + num2)
66
77# ============= Solution 02 =============
8+ print ("Welcome to TowSome programme" )
89num1 = float (input ("Enter first number :" ))
910num2 = float (input ("Enter second number :" ))
1011print ("Sum of given two numbers :" , num1 + num2 )
Original file line number Diff line number Diff line change 1+ print ("Welcome to Leap Year programme!" )
2+
3+ def check_leap_year (y ):
4+ if ((y % 4 == 0 ) and (y % 100 != 0 )) or (y % 400 == 0 ):
5+ print (str (y ) + " is a leap year !" )
6+ retry = input ("Do you want to retry? (y/q): " ).lower ()
7+ if retry != "y" :
8+ quit ()
9+ else :
10+ print (str (y ) + " is not a leap year" )
11+ retry = input ("Do you want to retry? (y/q): " ).lower ()
12+ if retry != "y" :
13+ quit ()
14+
15+ while True :
16+ y = input ("Enter year : " )
17+ if y .isnumeric ():
18+ y = int (y )
19+ check_leap_year (y )
20+ else :
21+ print ("Not a valid input" )
22+ retry = input ("Do you want to retry? (y/q): " ).lower ()
23+ if retry != "y" :
24+ break
You can’t perform that action at this time.
0 commit comments