Skip to content

Commit 7130007

Browse files
committed
Added excercise_8_leapyear.py multiple_if_stat.py to Python-Basic-to-Advance repo
1 parent 66e7a10 commit 7130007

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

excercise_8_leapyear.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
year=int(input("enter year:"))
2+
if year%4==0:
3+
if year%100==0:
4+
if year%400==0:
5+
print("Leap year")
6+
else:
7+
print("Not a leap year")
8+
else:
9+
print("Leap year")
10+
else:
11+
print("Not a leap year")

multiple_if_stat.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
height=int(input("What is your height?"))
2+
bill=0
3+
if height>=3:
4+
print("Can ride")
5+
age=int(input("What is your age?"))
6+
if age<12:
7+
bill=150
8+
print("Ticket price is 150 Rs.")
9+
elif age<=18:
10+
bill=250
11+
print("Ticket price is 250 Rs.")
12+
else:
13+
bill=500
14+
print("Ticket price is 500 Rs.")
15+
want_photo=input("Do you want to take photo(Y/N)?")
16+
if want_photo=='y' or want_photo=='Y':
17+
bill=bill+50
18+
print(f"Your total bill is {bill}.")
19+
else:
20+
print("Cant ride")
21+
print("bye")

0 commit comments

Comments
 (0)