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

Cbse Computer Science Project

Uploaded by

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

Cbse Computer Science Project

Uploaded by

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

CBSE COMPUTER

SCIENCE PROJECT

Topic: Python Assistant

PROJECT PREPARED BY:


1. Piyush Singh
2. Shivansh Gupta
XII-C
Session: 2021-2022
Tagore International School, EOK
TABLE OF CONTENTS

1. Introduction

2. Python Module Used and their Purpose

3. Source Code

4. Output

5. Limitations

6. Data Flow Diagram

7. Requirements

8. Bibliography
Introduction

Instead of buying a virtual assistant, we have created


our own virtual assistant using Python. It have access
to every Web Brower like Gmail, YouTube, etc.

This virtual assistant, which we have named as


Python, is very helpful. Instead of typing and
searching, we just need to say “Python search…” and
our work is done.

It can play whatever song you want, can perform


searches and can translate anything to English.

It have the access to various programs like games,


Covid report, membership forms and hotel
management. These python programs are also created
by us. We have made these programs in separate
python files and have imported them in our main
code(of python assistant).

In addition to all that, it can even tell jokes.


Python Module Used and their
Purpose

(In main program)


1. speech_recognition -> To recognize and store voice

2. pyttsx3 -> Text to speech converter module i.e talk()

3. pywhatkit -> To play a particular vedio on youtube

4. datetime -> To tell date and time

5. Wikipedia -> To get information from Wikipedia (to


perfrom searches)

6. pyjokes -> Tell jokes

7. webbrower -> Open web pages

8. translate -> For translation

Some other modules are:


1. pygame

2. turtle

3. matplotlib
Source Code
 Main code
#>>>>>Computer Science Project<<<<<
#To recognize and store voice
import speech_recognition as sr

#Text to speech converter module i.e talk()


import pyttsx3

#To play a particular vedio on youtube


import pywhatkit

#To tell date and time


import datetime
from datetime import date

#To get information from wikipedia


import wikipedia

#Tell jokes
import pyjokes

#Open web pages


import webbrowser

#For translation
from translate import Translator

#Recognizeour voice using microphone


listner=sr.Recognizer()

#opening another python file


from butter import *
from snake import *
from translator import *
from membership import *
from hotel import *
from covid import *

#Declare voice
engine=pyttsx3.init()
voices = engine.getProperty('voices')
engine.setProperty('voice',voices[0].id)

#Python talks the intro


engine.say("Hi I am python")
engine.say("What can i do for you?")
engine.runAndWait()

#Talk function for python


def talk(text):
engine.say(text)
engine.runAndWait()

def take_command():
try:
#Python listens
with sr.Microphone() as source:
print()
print("Listening...")
voice=listner.listen(source)
command=listner.recognize_google(voice)
command=command.lower()

from datetime import date


today = date.today()
d1 = today.strftime("%d %m %Y")

time =
datetime.datetime.now().strftime('%I:%M %p')

if 'python' in command:
with open("python_history.txt","a") as
fp:
fp.write(d1+' : '+time+"\n")
fp.write(command+"\n")
fp.write("\n")
command=command.replace('python ','')

print(command)

except:
return None

return command

#Doing work with Python

while True:
command=take_command()
if command== None:
continue

if 'play' in command:
song=command.replace('play ','')
print("The song",song,"is being played")
talk('playing'+song)
pywhatkit.playonyt(song)

elif 'time' in command:


time = datetime.datetime.now().strftime('%I:%M
%p')
talk('Current time is ' + time)
print(time)

elif 'search' in command:


person = command.replace('search', '')
info = wikipedia.summary(person, 1)
print(info)
talk(info)

elif 'joke' in command:


x=pyjokes.get_joke()
talk(x)
print(x)
elif 'gmail' in command:
webbrowser.open("www.gmail.com")

elif 'date' in command:


from datetime import date
today = date.today()
d1 = today.strftime("%d %m %Y")
print(d1)
talk(d1)

elif 'translate' in command:


from translate import Translator
#TRANSLATOR
text = input('Enter the text:')
org = input('Enter the language of the
text:').lower()
conv = input('Enter the language you want to
convert the text into:').lower()

translator=
Translator(from_lang=org,to_lang=conv)
translation = translator.translate(text)
print( translation)

elif 'over' in command:


talk("Thankyou, it was great talking to you")
talk("Hope to meet you soon")
break

elif 'register' in command:


registration()

elif 'covid result' in command:


covid__()

elif 'business' in command:


display()

elif 'game' in command:


display2()

elif 'hotel' in command:


hotelmanagement()

elif 'history' in command:


with open("python_history.txt","r") as fp:
a=input("Would you like to read or listen
the history?")
a.lower()
if a=='read':
print(fp.read())
else:
talk(fp.read())

elif 'introduce' in command:


with open("introduction.txt","r") as fd:
talk(fd.read())

else:
talk('sorry,can you repeat')
 Butter code (Business game source keeper)
def display():
a=input("Do you want to start the game?(y/n)")
if a=='y':
x=int(input("Enter the starting money for
player 1"))
y=int(input("Enter the starting money for
player 2"))
player1=input("Enter name of player 1")
player2=input("Enter name for player 2")
l1=[]
l2=[]
mortage1=[]
mortage2=[]
while True:
print("view money, pay rent, add site, mortage
site,view sites owned,pay to bank,collect from bank,pay
player")
option=input("Choose any of the above actions")

if option=="view money":
print("money for ",player1 ,"=",x)
print("Money for ",player2 ,"=",y)

elif option=="pay rent":


giver=input("Enter the name of the player
who is paying the money")
amount=int(input("Enter the amount to be
payed"))

if giver==player1:
if x-amount>=0:
x=x-amount
y=y+amount
print("money remaining for
",player1,"=",x)
print("money remaining for
",player2,"=",y)
elif x-amount<0:
print("Can't make transactions ,
not enough money")

elif giver==player2:
if y-amount>=0:
y=y-amount
x=x+amount
print("money remaining for
",player1,"=",x)
print("money remaining for
",player2,"=",y)

elif y-amount<0:
print("Can't make transactions ,
not enough money")

elif option=="add site":


name1=input("Enter the name of the player
who is purchasing a site")
site1=input("Enter name of the site owned")
price=int(input("Enter the price of the
site"))

if name1==player1:
if x-price>=0:
l1.append(site1)
x=x-price
print("sites owned
by",player1,":",l1)
print("remaining money=",x)
elif x-price<0:
print("Can't make transactions ,
not enough money")

elif name1==player2:
if y-price>=0:
l2.append(site1)
y=y-price
print("sites owned
by",player2,":",l2)
print("remaining money=",x)

elif y-price<0:
print("Can't make transactions ,
not enough money")

elif option=="mortage site":


name2=input("Enter the name of the player
who is mortaging a site")
site2=input("Enter name of the site
mortaged")
value=int(input("Enter the mortage value of
the site"))

if name2==player1:
x=x+value
l1.remove(site2)
mortage1.append(site2)
print("sites owned by",player1,":",l1)
print("sites mortaged
by",player1,":",mortage1)

elif name2==player2:
y=y+value
l2.remove(site2)
mortage2.append(site2)
print("sites owned by",player2,":",l2)
print("sites mortaged
by",player2,":",mortage2)

elif option=="view sites owned":


print("sites owned by",player1,":",l1)
print("sites mortaged
by",player1,":",mortage1)
print("sites mortaged by",player2,":",l2)
print("sites mortaged
by",player2,":",mortage2)

elif option=="pay to bank":


name3=input("Enter the name of the player
who has to pay the bank")
value2=int(input("Enter the amount to be
payed"))

if name3==player1:
if x-value2>=0:
x=x-value2
print("remaining balance:",x)

elif x-value2<0:
print("Can't make transactions ,
not enough money")

elif name3==player2:
if y-value2>=0:
y=y-value2
print("remaining balance:",y)

elif y-value2<0:
print("Can't make transactions ,
not enough money")

elif option=="collect from bank":


name4=input("Enter the name of the player
who has to pay the bank")
value3=int(input("Enter the amount to be
payed"))

if name4==player1:
x=x+value3
print("remaining balance:",x)

elif name4==player2:
y=y+value3
print("remaining balance:",y)

elif option=="pay player":


name5=input("Enter the name of the
player who has to pay")
value4-int(input("Enter the amount to
be payed"))

if name5==player1:
if x-value4>=0:
x=x-value4
y=y+value4
print(player1,"current
balance=",x)
print(player2,"current
balance=",y)

elif x-value4<0:
print("Can't make transactions
, not enough money")

if name5==player2:
if y-value4>=0:
y=y-value4
x=x+value4
print(player1,"current
balance=",x)
print(player2,"current
balance=",y)

elif y-value4<0:
print("Can't make transactions
, not enough money")

k=input("Do you want to continue?(y/n)")


if k=='n':
break
 Membership Form Code
def registration():
import turtle
print("Welcome to Saket Sports complex")
print('"Taking sports to a next level"')
print("Become a member of our club and take your
sports to the next level")
a=input("Would you like to become a member of our
club?")
l=['y','Y','yes','Yes']

if a in l:
d={}
d2={"one year":"Rs.1000/- per year",
"two year":"Rs.2000/- once in two year",
"Life time":"Rs.1500/- per year"
}
while True:
l=[]
name=input("Enter your name")
cont=input("Enter your contact number")
email=input("Enter your email address")
duration=input("Enter the duration of the
membership:")
l.append(cont)
l.append(email)
l.append(duration)
d[name]=l

#Membership card

t=turtle.Turtle()

wn = turtle.Screen()
wn.title("Membership Card")
wn.bgcolor("orange")
wn.setup(width=1300, height=500)
t.hideturtle()
t.penup()
t.goto(-400,140)
t.pendown()
t.color('black')
x="Saket sports complex"
t.write(x,font=('courier',50,'bold'))
t.penup()
t.goto(-250,100)
t.pendown()
t.color('black')
y="'taking sports to a next level'"
t.write(y,font=('courier',20,'italic'))
t.hideturtle()
t.penup()
t.goto(-150,30)
t.pendown()
t.color('white')
z="Membership Card"
t.write(z,font=('courier',30,'bold'))
t.penup()
t.goto(-630,-60)
t.pendown()
t.color('blue')
t.write("Name:
{}".format(name),font=('courier',15,'italic'))
t.penup()
t.goto(150,-60)
t.pendown()
t.color('blue')
t.write("Contact number:
{}".format(cont),font=('courier',15,'italic'))
t.penup()
t.goto(-630,-120)
t.pendown()
t.color('blue')
t.write("Email address:
{}".format(email),font=('courier',15,'italic'))
t.penup()
t.goto(150,-120)
t.pendown()
t.color('blue')
t.write("Validity period:
{}".format(duration),font=('courier',15,'italic'))

turtle.done()

break

print("Your fee will be:",d2.get(duration))


print("Congrats you are now a memeber of Saket
sports complex and here is your memebrship card")
print(d)
 Covid Report Code
#COVID PROJECT
def covid__():
import matplotlib.pyplot as plt

#dict->{ state : [ capital , total confirmed


cases , death ] }

#data of 13.4.2021

state={
'Andhra Pradesh' : [ 'Amaravati' , 928664
, 7311 ] , 'Arunachal Pradesh' : [ 'Itanagar' , 16889 ,
56 ] ,
'Assam' : [ 'Dispur' , 220893 , 1118 ] ,
'Bihar' : [ 'Patna' , 286228 , 1616 ] ,
'Chhattisgarh' : [ 'Raipur' , 31167 , 400
] , 'Goa' : [ 'Panaji' , 62780 , 850 ] ,
'Gujarat' : [ 'Gandhinagar' , 353516 ,
4855 ] , 'Haryana' : [ 'Chandigarh' , 320699 , 3282 ] ,
'Himachal Pradesh' : [ 'Shimla' , 70775 ,
1124 ] , 'Jharkhand' : [ 'Ranchi' , 141750 , 1232 ] ,
'Karnataka' : [ 'Bangalore' , 1074869 ,
12941 ] , 'Kerala' : [ 'Thiruvananthapuram' , 1172882 ,
4794 ] ,
'Madhya Pradesh' : [ 'Bhopal' , 344634 ,
4221 ] , 'Maharashtra' : [ 'Mumbai' , 3458996 , 58245 ]
,
'Manipur' : [ 'Imphal' , 29514 , 376 ] ,
'Meghalaya' : [ 'Shillong' , 14300 , 151 ] ,
'Mizoram' : [ 'Aizawl' , 4655 , 12] ,
'Nagaland' : [ 'Kohima' , 12416 , 93 ] ,
'Odisha' : [ 'Bhubaneshwar' , 351302 ,
1928 ] , 'Punjab' : [ 'Chandigarh' , 276223 , 7559 ] ,
'Rajasthan' : [ 'Jaipur' , 369564 , 2951
] , 'Sikkim' : [ 'Gangtok' , 6410 , 136 ] ,
'Tamil Nadu' : [ 'Chennai' , 940145 ,
12927 ] , 'Telangana' : [ 'Hyderabad' , 332581 , 1772 ]
,
'Tripura' : [ 'Agartala' , 33805 , 394 ]
, 'Uttarakhand' : [ 'Dehradun' , 110146 , 1767 ] ,
'Uttar Pradesh' : [ 'Lucknow ' , 705619 ,
9224 ] , 'West Bengal' : [ 'Kolkata' , 619407 , 10414 ]
}

def mod(state):
print()
print('what do you want to change?\n1.number of
deaths\n2.total confirmed cases')
print()

a=int(input('enter your choice?'))

if a==1:
st=input('enter the state name').title()
new=int(input('enter the new value:'))
print()

if st in state:
value=state[st]
value[2]=new
print('Data Updated!')

else:
print('state not found')

elif a==2:
st=input('enter the state name').title()
new=int(input('enter the new value:'))
print()

if st in state:
value=state[st]
value[1]=new
print('Data Updated!')

else:
print('state not found')
print()
return(state)

def search(state):
print()
st=input('enter the state name you want to
search:').title()

if st in state :
print('state found')
print()
print(st)
value=state[st]
print('Capital :',value[0])
print('Confirmed Cases :',value[1])
print('Death :',value[2])

#graph
x=['Confirmed Cases' , 'Death Rate']
y=[value[1],value[2]]
plt.bar(x,y)
plt.xlabel('x-axis')
plt.ylabel('y-axis')
plt.title('Graphical Representation')
plt.grid()
plt.show()

print()

def display(state):
key=[]
val1=[]
val2=[]
for x,y in state.items():
key.append(x)
val1.append(y[1])
val2.append(y[2])

#graph on total cases


y = val1
labels = key
plt.pie(y, labels = labels)
plt.legend(title = "Total Confirmed Cases:")
plt.show()

#graph on total death


x=key
y=val2
plt.barh(x, y,color='purple')
plt.title('Death Rate')
plt.show()

while True:
print('1.Modify any previous data')
print('2.Search for any state')
print('3.Show all data')
print('4.Show dicticionary')
print('5.Exit')
print()
x=int(input('enter your choice:'))
print()

if x==1:
state = mod(state)

elif x==2:
search(state)

elif x==3:
display(state)

elif x==4:
print(state)

print()
elif x==5:
break

else:
print('enter the valid number')
 Snake Game Code
def display2():
try:
import turtle
import time
import random
from playsound import playsound
import pygame

delay = 0.1

#Music selection
print("Music List:")
print("shipping lanes")
print("destination")
print("epicness")
print("Sngs by Alan Walker are as listed
below:")
print("lily")
print("darkside")
print("play")
print("ignite")
print("on my way")
print("Hymn For The Weekend")
print("umbrella-ember island")

# Score
score = 0
high_score = 0
#Snake Body
se=("square")
sc=("pink")

#music
from pygame import mixer
x=input("Enter the name of the song you want to
be played in the background(choose from the list
above):")
pygame.mixer.init()
mixer.music.load('{}.mp3'.format(x))
mixer.music.play(-1)

#setup the screen


wn = turtle.Screen()
wn.title("Musical Snake Game by Shivansh Gupta
song currently playing: {}".format(x))
wn.bgcolor("black")
wn.setup(width=600, height=600)
wn.tracer(0) #Turns off the screen updates

#Snake head
a=("square")
b=("white")
head = turtle.Turtle()
head.speed(0)
head.shape(a)
head.color(b)
head.penup()
head.goto(0,0)
head.direction = "stop"

#Snake food
c=("circle")
d=("red")
food = turtle.Turtle()
food.speed(0)
food.shape(c)
food.color(d)
food.penup()
food.goto(0,100)

segments = []

#Pen

pen = turtle.Turtle()
pen.speed(0)
pen.shape("square")
pen.color("white")
pen.penup()
pen.hideturtle()
pen.goto(0,260)
pen.write("Score: 0 High Score: 0", align =
"center",font=("Courier",24,"normal"))

#Functions
def go_up():
if head.direction != "down":
head.direction = "up"

def go_down():
if head.direction != "up":
head.direction = "down"

def go_left():
if head.direction != "right":
head.direction = "left"

def go_right():
if head.direction != "left":
head.direction = "right"
def move():
if head.direction == "up":
y = head.ycor()
head.sety(y+20)

if head.direction == "down":
y = head.ycor()
head.sety(y-20)

if head.direction == "left":
x = head.xcor()
head.setx(x-20)

if head.direction == "right":
x = head.xcor()
head.setx(x+20)
#Keyboard bindings
wn.listen()
wn.onkeypress(go_up,"Up")
wn.onkeypress(go_down,"Down")
wn.onkeypress(go_left,"Left")
wn.onkeypress(go_right,"Right")

#Main Game loop

while True:
wn.update()
#Check for a collision with the border
if head.xcor()>290 or head.xcor()<-290 or
head.ycor()>290 or head.ycor()<-290:
time.sleep(1)
head.goto(0,0)
head.direction = "stop"

#Keboard bindings reverse


wn.listen()
wn.onkeypress(go_up,"Down")
wn.onkeypress(go_down,"Up")
wn.onkeypress(go_left,"Right")
wn.onkeypress(go_right,"Left")

#Hide the segments

for segment in segments:


segment.goto(2000,20000)

#Clear the segments list


segments= []
#changed this part so that score doesnt become
negative after going down to 0
# Increase in Score
if score>0:
score -= 10 # Same as score =
score-10
else:
score=0
if score > high_score:
high_score = score
pen.clear()
pen.write("Score: {} High Score
{}".format(score,high_score),align="center",font=("Cour
ier",24,"normal"))

#Reset the delay

delay = 0.1

#Check for a collision with the food

if head.distance(food)<20:
# Move the food to a random spot
x = random.randint(-290,290)
y = random.randint(-290,290)
food.goto(x,y)

#Add a segmet
new_segment = turtle.Turtle()
new_segment.speed(0)
new_segment.shape(se)
new_segment.color(sc)
new_segment.penup()
segments.append(new_segment)

#Shorten the Delay


delay -= 0.001 #Same as delay=delay-
0.001

# Increase in Score

score += 10 # Same as score = score+10

if score > high_score:


high_score = score
pen.clear()
pen.write("Score: {} High Score
{}".format(score,high_score),align="center",font=("Cour
ier",24,"normal"))

#Move the segment first in reverse order

for index in range (len(segments)-1,0,-1):


x = segments[index-1].xcor()
y = segments[index-1].ycor()
segments[index].goto(x,y)

#Move segment 0 to where the head is


if len(segments) > 0:
x = head.xcor()
y = head.ycor()
segments[0].goto(x,y)

move()

#Check for head collisions with the body segments


for segment in segments:
if segment.distance(head) < 20:
time.sleep(1)
head.goto(0,0)
head.direction = "stop"

#Hide the segments


for segment in segments:
segment.goto(1000,1000)

#Clear the segments list


segments= []
#Reset the score
score = 0

#Update the score Display


pen.clear()
pen.write("Score: {} High Score
{}".format(score,high_score),align="center",font=("Cour
ier",24,"normal"))

#Reset the delay

delay = 0.1

time.sleep(delay)

wn.mainloop()

except:
mixer.music.stop()
pass
 Hotel Mangement Code
#Project-'Hotel Management'
def hotelmanagement():
import random as r
x=1
def bill(rec,feed,feed1,l):
cust=input('Enter the customer name:')
ph=int(input('Enter the phone number:'))
cus=cust.title()
if cus not in rec:
print('Name not found')
return rec , feed1,l
else:
x=rec.get(cus)
print(x)
y=x.get('Room number:')
for i in x.values():
if i!=ph:
print('Wrong number entered')
return rec , feed1,l
else:
print('Charges:')
print('a.Stay per
day=Rs.750\nb.Pick and drop service=Rs.200')
print('c.Tourist Guide charge(per
day)=Rs.200')
days=int(input('Enter the days of
stay:'))
g_days=int(input('Enter the days
with guide(if not included enter 0):'))
drop=input('Pick and Drop service
is included (yes/no):')
if drop =='yes' or 'Yes':

cost=(days*750)+(g_days*200)+200
else:
cost=(days*750)+(g_days*200)
print('Amount to be pay=Rs.',cost)
print('Thank you for visiting
us!!!')
rate=int(input('Please rate our
services out of 5:'))
feedback=input('Please give your
feedback:')
del rec[cus]
feed.append(ph)
feed.append(rate)
feed.append(feedback)
feed1[cus]=feed
l.remove(y)

return rec , feed1 ,l

def phno(rec,whose):
phn=int(input('Enter the new phone number:'))
x=rec[whose]
d={'Ph number:':phn}
x.update(d)
print('Changed successfully')
return rec

def room(rec,whose,l):
old=int(input('Please confirm your old room
number:'))
print('Room available are: ',end='')
for i in range(1,11):
if (i not in l )and (old!=i):
print(i,end=',')
print()
rono=int(input('Which room do you want?'))
x=rec[whose]
d={'Room number:':rono}
x.update(d)
l.append(rono)
l.remove(old)
print('Changed successfully')
return rec,l
def book(rec,l):
detail={}
if len(l)==10:
print('Sorry, no room is available')
return (rec,l)
name=input("Enter the customer's name:")
name=name.title()
ph=int(input("Enter the customer's ph.
number:"))
while True:
r_no=r.randint(1,10)
if r_no not in l:
l.append(r_no)
break

print('Your booking is done! Your room number


is',r_no)
detail['Ph number:']=ph
detail['Room number:']=r_no
rec[name]=detail
return (rec,l)

def start2(opt,rec,l,feed,feed1,st):
x=0
if opt==1:
rec,l=book(rec,l)
print()
y_n=input('Do you want to explore
more?')
yn=y_n.title()
if yn =='Yes':
option(rec,l,x,feed,feed1,st)

elif opt==2:
print(rec)
for x,y in rec.items():
print('Customer name:',x)
for a,b in y.items():
print(a,':',b)
y_n=input('Do you want to explore
more?')
yn=y_n.title()
if yn =='Yes':
option(rec,l,x,feed,feed1,st)

elif opt==3:
rec,feed1,l=bill(rec,feed,feed1,l)
print(feed1)
y_n=input('Do you want to explore
more?')
yn=y_n.title()
if yn =='Yes':
option(rec,l,x,feed,feed1,st)

elif opt==4:
whose=input('Whose id you want to
change?')
whose=whose.title()
for a,b in rec.items():
if whose not in rec:
print('.',end='')
else:
print('Current Status:')
print('Customer
name:',whose)
x=rec.get(whose)
break
for p,q in x.items():
print(p,q)
wh=int(input('What you want to
change?(1-ph number 2-room)'))
if wh==1:
rec=phno(rec,whose)
y_n=input('Do you want to
explore more?')
yn=y_n.title()
if yn =='Yes':

option(rec,l,x,feed,feed1,st)
elif wh==2:
rec,l=(room(rec,whose,l))
y_n=input('Do you want to
explore more?')
yn=y_n.title()
if yn =='Yes':

option(rec,l,x,feed,feed1,st)

elif opt==5:
st=opt5(opt,rec,l,st,feed,feed1)
y_n=input('Do you want to explore
more?')
yn=y_n.title()
if yn =='Yes':
print('You are requested
to login again')
start_for5(st)

def opt5(opt,rec,l,st,feed,feed1):
if opt==5:
guest=input('Please type your
name first to type your complaint:')
guest=guest.title()
if guest in rec:
feed=input('Please enter
your complaint here:')
print('Your complaint has
been registered in the name of',guest)
com=guest+'-'+feed
st.append(com)
print(st)
else:
print('Only our guests can
type their complaints here.')
print('You are requested to
login again')
x=1
start_for5(st)
return (st)

def start_for5(st):
x=0
username = input("Enter username: ")
password = input("Enter password: ")
if(username=="admin" and password
=="12345"):
print('Login Successful')
print()
option(rec,l,x,feed,feed1,st)
else:
print('Account Blocked')

def start(opt,rec,l,feed,feed1,st):
if opt<5:
print('You have to login in to use this
function')
username = input("Enter username: ")
password = input("Enter password: ")
if(username=="admin" and password
=="12345"):
print('Login Successful')
print()
a=1
else:
a=0
print('Account Blocked')
if a==1:
x=0
start2(opt,rec,l,feed,feed1,st)
else:
opt5(opt,rec,l,st,feed,feed1)

def option(rec,l,x,feed,feed1,st):
print(' '*16,'Welcome To Dream Hotel !!!')
print('How can I help you?')
print()
print('1.Booking of a room')
print("2.Guest's information")
print("3.Bill")
print("4.Updating")
print("5.Complaint/Feedback")
print("6.Exit")
opt=int(input('Please enter a vaild number:'))
if x==1 and opt<5:
start(opt,rec,l,feed,feed1,st)
else:
start2(opt,rec,l,feed,feed1,st)

rec={}
l=[]
feed=[]
feed1={}
st=[]
option(rec,l,x,feed,feed1,st)
Output

Link for the output video:

Limitations
1. Active internet connection is needed
otherwise an error will raise.

2.
Data Flow Diagram

Snake Game
Membership Hotel
Form Mangement
App

display2()
Python
(Virtual
Assistant)

Pywhatkit,
webbrower

Covid Report Business


Game Source
Web Pages Keeper
(like youtube,
gmail, etc.)

ALL THE COMMANDS GIVEN TO


PYTHON ASSISTANT ARE STORED
IN A TEXT FILE-
“python_history.txt”.
Requirements to run the code error-
Free

 Modules to download:
1. Pygame
2. Matplotlib
3. Pywhatkit
4. SpeechRecognition
5. Pyttsx3
6. Pyaudio
7. Translate
8. Webbrower

 Pre-installed Modules:
1. Turtle
2. Pyjokes
3. Wikipedia
4. datetime
Bibliography

1. www.youtube.com
2. www.pygame.org
3. Workshop on CS and Engineering by
United College of Engineering &
Research
4. NCERT Book Class11
5. Sumita Arora Book Class12

You might also like