0% found this document useful (0 votes)
19 views

Program5-Write To Make A Program A Pattern by Using While Loop: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5

The document contains programs to solve various problems using Python programming. It includes programs to draw patterns, check triangle properties, find cone properties, verify trigonometric identities, create lists, dictionaries, ATM simulation, and more. It also has programs to calculate student marks and check eligibility for a particular course.

Uploaded by

kumudnegi12
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Program5-Write To Make A Program A Pattern by Using While Loop: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5

The document contains programs to solve various problems using Python programming. It includes programs to draw patterns, check triangle properties, find cone properties, verify trigonometric identities, create lists, dictionaries, ATM simulation, and more. It also has programs to calculate student marks and check eligibility for a particular course.

Uploaded by

kumudnegi12
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Program5- Write to make a program a pattern by using while loop:

1
12
123
1234
12345

Programming:-

n=5
for i in range(n):
for j in range(n-i-1):
print(" ",end=" ")
for j in range(i+1):
print(j+1,end=" ")
print( )
Program6- Write a program to make a list of 10 elements by using user input. Search an
element by user’s choice by using linear search.

Programming:-

a=int(input("Enter the length of list"))


L=[]
for i in range(1,a+1):
L1=int(input("Enter Value in a list"))
L.append(L1)
print("The List is",L)
b=int(input("Enter the value which we have to search"))
if b in L:
print("The enter number ",b,"is in list.","Its index number=",L.index(b))
else:
print("The enter number ",b,"is not in list")
Program2- Write a program to input three values as sides of a triangle. Check it is a equilateral
triangle, isosceles, scalene or right angled triangle. Also find the area and perimeter of triangle
formed.

Programming:-

a=float(input('Enter first side in cm='))


b=float(input('Enter second side in cm='))
c=float(input('Enter third side in cm='))
if a+b>c and b+c>a and a+c>b:
if a==b==c:
print("It is an Equilateral Triangle")
elif a**2==b**2+c**2 or b**2==a**2+c**2 or c**2==b**2+a**2:
print("It is an Right-Angled Triangle")
elif a==b!=c or b==c!=a or a==c!=b:
print("It is an Isosceles Triangle")
elif a!=b!=c:
print("It is an Scalene Triangle")
else:
print("triangle is not possible")
perimeter=a+b+c
print('Perimeter of the Triangle=',perimeter,'cm')
s=perimeter/2
area=(s*(s-a)*(s-b)*(s-c))**(1/2)
print('Area of the Triangle=',area,'cm sq.')
Program8- Write a program to find the sum of the given series up to 10 terms.

𝑥+ !
+ !
+ ⋯.

Programming:-

x=int(input('Enter the value of x '))


n=10
total=0
fact=1
for i in range(1,n+1):
for j in range(1,i+1):
fact=fact*j
total=total+(x**i)/fact
print('The sum of the series x+x^2/2!+x^3/3!+⋯. is',total)
ACKNOWLEDGEMENT

I would like to convey my sincere thanks to


Mr. Kaushal Bahuguna sir, my computer
science teacher,
Who always gave me valuable suggestions and
guidance during the project. He has a source of
inspiration and helped me understand and
remember the important details of the project. He
gave me an amazing opportunity to do this
wonderful project.

I also thank my parents and friends for their help


and support in finalising this project within the
limited time frame.
CERTIFICATE BY STUDENT

I Kumud Negi, student of class XI Harsil of


Social Baluni Public School.
Hereby certify that the project was undertaken
by me as per the CBSE curriculum. I take it to
be authentic and reliable.
Program7- Write a program to make a dictionary by user’s choice apply pop(), key(), values()
and popitem() functions on it.
After applying every function generate separate output for each.

Programming:-

D={}
n=int(input("Enter number of items in the dictionary"))
for i in range(1,n+1):
a=input("Enter value of key")
D[i]=a
print('Dictionary=',D)
b=D.keys()
c=D.values()
print("The output of keys():",b)
print("The output of values():",c)
d=int(input('Enter the key of that item which have to be deleted'))
pop=D.pop(y)
p=D.popitem()
print("The output of pop():",pop)
print("The output of popitem():",p)
Program10- Write a program to create a dictionary in which key value pair is your subject(key)
and marks(values) of 10th class. Find out the sum and percentage of your marks and conclude
your division according to given data:
60%-100% - 1st
45%-59% -2nd
33%-44%-3rd
Show your maths and science marks separately. If you got 75% in these two subject. Then leave
a message “You are eligible to take PCM in class11th” otherwise not.

Programming:-

a=int(input("Enter your English number"))


b=int(input("Enter your Hindi number"))
c=int(input("Enter your Maths number"))
e=int(input("Enter your Science number"))
f=int(input("Enter your Social Science number"))
g=int(input("Enter your Information Technology number"))
d={}
d["English"]=a
d["Hindi"]=b
d["Maths"]=c
d['Science']=e
d['Social Science']=f
d['Information Technology']=g
print('Your numbers are',d)
h=a+b+c+e+f+g
print('Total Marks-',h)
i=(h*100)//600
print('Your Percentage',i,'%')
if i>=60:
print('Division 1')
elif i<59 or i>45:
print('Division 2')
elif i<44 or i>33:
print("Division 3")
else:
print('You are Fail')
j=b+c
k=(j*100)/200
if k>=75:
print('You are eligible to take PCM in class11')
else:
print('You are not eligible to take PCM in class11')
Program1- Write a Program to draw a pattern of your name in given format by using for loop:-
1
12
123
1234

Programming:-

a=input('Enter your name')


b=len(a)
for i in range (1,b+1):
for j in range(0,i):
print(a[j],end=' ')
print()
Program3- Write a Program to accept the values of height & radius of a cone. Also find its CSA,
TSA and volume.

Programming:-

h=float(input("height of cone="))
r=float(input("radius of cone="))
l=(h**2+r**2)**(1/2)
π=3.14
CSA=π*r*l
TSA=π*r*(l+r)
Volume=(π*h*r**2)*1/3
print("CSA of cone=",CSA)
print("TSA of cone=",TSA)
print("volume of cone=",Volume)
INDEX
1. Write a program to draw a pattern of your name in given format by using for
loop.
1
12
123
1234

2. Write a program to input three values as sides of a triangle. Check it is a


equilateral triangle, isosceles, scalene or right angled triangle. Also find the area
and perimeter of triangle formed.
3. Write a program to accept the values of height & radius of a cone. Also find
its CSA, TSA and volume.
4. Write a program to satisfy the equation for trigonometric identity.
Sin2x+cos2=1
5. Write a program to make a pattern by using while loop.
1
12
123
1234
12345
6. Write a program to make a list of 10 elements by using user input. Search an element by
user’s choice by using linear search.
7. Write a program to make a dictionary by user’s choice apply pop(), key(), values() and
popitem() functions on it.
After applying every function generate separate output for each.
8. Write a program to find the sum of the given series up to 10 terms.

𝑥+ + + ⋯.
! !

9. Write a program to make a mini ATM machine in which 5 major functions to be


calculated:
1-Enter pin if correct then enter for other function
2-Withdraw
3-Mini Statement
4-Check last balance
5-Change pin
10. Write a program to create a dictionary in which key value pair is your subject(key) and
marks(values) of 10th class. Find out the sum and percentage of your marks and conclude
your division according to given data:
60%-100% - 1st
45%-59% -2nd
33%-44%-3rd
Show your maths and science marks separately. If you got 75% in these two subject. Then l

You might also like