Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Create Python solution in Queue #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Data Structures/Queue/Queue.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
class Queue:
def __init__(self):
self.queue=[]
def enque(self,item):
self.queue.append(item)
def deque(self):
if(len(self.queue)<1):
return None
return self.queue.pop(0)
def display(self):
print(self.queue)
obj=Queue()
while True:
print("\nYour options")
print("1.for Enqueue")
print("2.for Deque")
print("3.for Display")
print("4. EXIT")
choice=int(input("\n Enter any one of the above"))
if(choice==1):
k=int(input("Please Enter Your Value"))
obj.enque(k)
elif (choice==2):
obj.deque()
elif (choice==3):
obj.display()
elif (choice==4):
break
else:
print("Enter an Valid option")