Assignmentm
Assignmentm
Programing:-
A
A R
A RP
A RP I
A R P IT
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.
Programing:-
Programing:-
Programing:-
row=1
while row<=5:
spaces=5-row
while spaces>0:
print(" ",end="")
spaces-=1
column=1
while column<=row:
print(column,end="")
column+=1
print()
row+=1
Output:-
1
12
123
1234
12345
Program 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.
Programing:-
The List is [787, 654, 987, 354, 789, 159, 357, 459, 426, 789]
Enter the value which we have to search789
The enter number 789 is in list. Its index number= 4
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.
Programing:-
D={}
x=int(input("Enter number of items in a dictionary"))
for i in range(1,x+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)
y=int(input('Enter the key of that item which have to be deleted'))
r=D.pop(y)
s=D.popitem()
print("The output of pop()-",r)
print("The output of popitem()-",s)
Output:-
Programing:-
Programing:-
pin=1256
a=int(input("Enter Your Pin"))
if a==pin:
print("withdrawl , check statement , change pin")
w="withdrawl"
c="check statement"
d="change pin"
b=input("Enter The Service You Would Like")
if(b==w):
print("100 , 500 , 2000")
e=int(input("Enter The Type Of Notes You Would Like"))
if(e==100):
f=int(input("Enter The Amount Required"))
print("Please Wait")
if(e==500):
g=int(input("Enter The Amount"))
print("Please Wait")
if(e==2000):
h=int(input("Enter The Amount Required"))
print("Please Wait")
if(b==c):
print("Would u like to check ur account balance")
o=input()
if(o=="yes"):
print("Your Remaining Balance Is 200000")
if(o=="no"):
print("Please go back to home page")
if(b==d):
print("Enter Your Current Pin")
p=int(input())
if(p==1222):
print("Enter Your New Pin")
q=int(input())
print("Your Pin Has Been Changed")
else:
print("Incorrect Pin")
else:
print("Your Pin Is Incorrect")
Output:-
Programing:-
d={}
d["English"]=g
d["Hindi"]=a
d["Maths"]=b
d['Science']=c
d['Social Science']=e
d['Information Technology']=f
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')
Output:-
****INPUT****
Enter the length of list10
Enter Value in a list456
Enter Value in a list654
Enter Value in a list987
Enter Value in a list354
Enter Value in a list789
Enter Value in a list951
Enter Value in a list753
Enter Value in a list459
Enter Value in a list624
Enter Value in a list789
****OUTPUT****
The List is [456, 654, 987, 354, 789, 951, 753, 459, 624, 789]
****INPUT****
Enter the value which we have to search987
****OUTPUT****
The enter number 987 is in list. Its index number= 2
INDEX
1. Write a program to draw a pattern of your name in given format by using
for loop
1
12
123
1234
3. Write a program to accept the values of height & radius of a cone. Also
find its CSA, TSA and volume.
𝑥+ + +⋯
! !