Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

13/10/2021, 00:51 ManojSir - Jupyter Notebook

In [ ]:

1 # 5.15 LAB:Remove gray from RGB


2 red = int(input())
3 green = int(input())
4 blue = int(input())
5 gray = min(red,blue,green)
6
7 print(red-gray,green-gray,blue-gray)

In [ ]:

1 # 5.16 LAB:Smallest number


2 x=int(input())
3 y=int(input())
4 z=int(input())
5 print(min(x,y,z))

In [ ]:

1 # 5.17 LAB:Interstate highway numbers


2 n=int(input())
3 if n>99:
4 n%=100
5 direction="north/south" if n%2==1 else "east/west"
6 print(f"I-{n} is primary, going {direction}.")
7

localhost:8888/notebooks/Python Programs/ManojSir.ipynb# 1/4


13/10/2021, 00:51 ManojSir - Jupyter Notebook

In [ ]:

1 # 5.18 LAB:Seasons
2 month = input()
3 day = int(input())
4
5 if month in ('January', 'February', 'March'):
6 season = 'winter'
7 elif month in ('April', 'May', 'June'):
8 season = 'spring'
9 elif month in ('July', 'August', 'September'):
10 season = 'summer'
11 elif month in ('October','November','December'):
12 season = 'autumn'
13 else:
14 season = 'Invalid'
15
16 if season !='Invalid':
17 if (month == 'March') and (day > 19):
18 season = 'spring'
19 elif (month == 'June') and (day > 20):
20 season = 'summer'
21 elif (month == 'September') and (day > 21):
22 season = 'autumn'
23 elif (month == 'December') and (day > 20):
24 season = 'winter'
25
26 if 1>day or day>31:
27 season = 'Invalid'
28
29 print(season)

localhost:8888/notebooks/Python Programs/ManojSir.ipynb# 2/4


13/10/2021, 00:51 ManojSir - Jupyter Notebook

In [ ]:

1 # 5.19 LAB:Exact change


2 amount = int(input())
3 if amount<=0:
4 print('No change')
5 else:
6 dollar = amount//100
7 amount%=100
8
9 quarter = amount//25
10 amount%=25
11
12 dime = amount//10
13 amount%=10
14
15 nickel = amount//5
16 amount%=5
17
18 penny = amount
19
20 # result
21 if dollar>=1:
22 if dollar == 1:
23 print(f"{dollar} Dollar")
24 else:
25 print(f"{dollar} Dollars")
26
27 if quarter>=1:
28 if quarter == 1:
29 print(f"{quarter} Quarter")
30 else:
31 print(f"{quarter} Quarters")
32
33 if dime>=1:
34 if dime == 1:
35 print(f"{dime} Dime")
36 else:
37 print(f"{dime} Dimes")
38
39 if nickel>=1:
40 if nickel == 1:
41 print(f"{nickel} Nickel")
42 else:
43 print(f"{nickel} Nickels")
44
45 if penny>=1:
46 if penny == 1:
47 print(f"{penny} Penny")
48 else:
49 print(f"{penny} Pennies")

localhost:8888/notebooks/Python Programs/ManojSir.ipynb# 3/4


13/10/2021, 00:51 ManojSir - Jupyter Notebook

In [ ]:

1 # 5.20 LAB:Leap year


2 year = int(input())
3 if year%400 == 0:
4 print(f"{year} - leap year")
5 else:
6 if year%100 == 0:
7 print(f"{year} - non leap year")
8 elif year%4 == 0:
9 print(f"{year} - leap year")
10 else:
11 print(f"{year} - non leap year")

In [ ]:

1 # 5.21 LAB:Warm up: Automobile service center


2 print("Enter desire auto service")
3 service = input()
4 print(f"You entered: {service}")

localhost:8888/notebooks/Python Programs/ManojSir.ipynb# 4/4

You might also like