You are on page 1of 3

AIM :

To write a programm for creating a


contact book , writing tables , sorting and
generating passwords.

SOURCE CODE :
print("Menu")
print("1.Math Tables")
print("2.Password Generator")
print("3.Contact Book")
print("4.Sorting")
ch=int(input("Enter choice 1-4:"))
if ch==1:
x=int(input("enter number:"))
n=int(input("How many terms:"))
for i in range(1,n+1):
y=x*i
print(x,"x",i,"=",y)
elif ch==2:
z=int(input("enter range:"))
import random
random.randint(1,z)
random.randint(1,z)
random.randint(1,z)
random.randint(1,z)
elif ch==3:
a=int(input("How many times:"))
d={}
for i in range(a):
name=input("Name:")
ph=int(input("Enter number:"))
d[name]=ph
print(d)
elif ch==4:
b=list(input("Enter list:"))
print(b)
b.sort()
print("sorted dictionary is")
print(b)
else:
print("Programm Finished")

OUTPUT :
Menu
1.Math Tables
2.Password Generator
3.Contact Book
4.Sorting
Enter choice 1-4:1
enter number:64
How many terms:10
64 x 1 = 64
64 x 2 = 128
64 x 3 = 192
64 x 4 = 256
64 x 5 = 320
64 x 6 = 384
64 x 7 = 448
64 x 8 = 512
64 x 9 = 576
64 x 10 = 640

RESULT :
The programm has been executed
successfully and the output has been shown.

You might also like