IP Prac
IP Prac
SESSION 2021-22
PRACTICAL FILE
22760
XI SCI-A
INDEX
10 To find the sum of squares of the first 100 natural numbers. 23-24
1
INPUT (Practical - 1)
2
OUTPUT (Practical - 2)
3
INPUT (Practical - 2)
4
OUTPUT (Practical - 3)
Select a shape :-
(a) Triangle
(b) Rectangle
(c) Square
(d) Circle
=> d
Enter the radius of circle : 14
Area of circle : 615.44
Circumference of circle : 87.92
5
INPUT (Practical - 3)
PI = 3.14
def square(s):
area = float(s*s)
print("Area of square :", area)
peri = float(4*s)
print("Perimeter of square :", peri)
def circle(r):
area = float(PI*r**2)
print("Area of circle :", area)
peri = float(2*PI*r)
print("Circumference of circle :", peri)
print('''
Select a shape :-
(a) Triangle
(b) Rectangle
(c) Square
(d) Circle
''')
6
if usr_inp == "a":
b=float(input("Enter the base of right angled triangle : "))
h=float(input("Enter the height of right angled triangle : "))
triangle(b, h)
else:
print("Invalid Option!")
7
8
OUTPUT (Practical - 4)
9
INPUT (Practical - 4)
SI = (P*R*T)/100
CI = P*((1 + R/100)**T - 1)
10
OUTPUT (Practical - 5)
11
INPUT (Practical - 5)
12
OUTPUT (Practical - 6)
13
INPUT (Practical - 6)
r = R/(12*100)
14
OUTPUT (Practical - 7)
=> b
Enter your Taxable Income (₹) : 800000
Income Tax : ₹160000.0 (20%)
15
INPUT (Practical - 7)
print('''
Select what to calculate :-
(a) GST
(b) Income Tax
''')
if usr_inp1 == "a":
cost = float(input("Enter Original Cost (₹) : "))
print('''
Select GST Rate :-
(a) 5%
(b) 12%
(c) 18%
(d) 28%
''')
if usr_inp2 == "a":
GST_rate = 5
else:
print("Invalid Option!")
16
if usr_inp1 == "b":
usr_inp3 = float(input("Enter your Taxable Income (₹) : " ))
17
18
OUTPUT (Practical - 8)
19
INPUT (Practical - 8)
min_value = min(list1)
max_value = max(list1)
print('''
Smallest number : {0}
Largest number : {1}
'''.format(min_value, max_value))
20
OUTPUT (Practical - 9)
24
21
INPUT (Practical - 9)
x = sorted(list1)[-n]
print(x)
22
OUTPUT (Practical - 10)
23
INPUT (Practical - 10)
n = 100
sum = 0
for i in range(n+1):
sum += i**2
24
OUTPUT (Practical - 11)
Enter a number : 8
Enter number of multiples : 10
Multiples are : 8 16 24 32 40 48 56 64 72 80
25
INPUT (Practical - 11)
multiple(num, n)
26
OUTPUT (Practical - 12)
27
INPUT (Practical - 12)
def count_vowel(str):
c = 0
v = "aeiouAEIOU"
for a in str:
if a in v:
c += 1
print("Number of vowels :", c)
string = input("Enter a String : ")
count_vowel(string)
28
OUTPUT (Practical - 13)
29
INPUT (Practical - 13)
for i in string.split():
if i.startswith(a):
print(i)
30
OUTPUT (Practical - 14)
31
INPUT (Practical - 14)
c = 0
for i in string.lower():
if i == a:
c += 1
32
OUTPUT (Practical - 15)
33
INPUT (Practical - 15)
for i in range(n):
34