-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueueImplementation.py
More file actions
43 lines (41 loc) · 1.06 KB
/
QueueImplementation.py
File metadata and controls
43 lines (41 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
iArr = []
while True:
iChoice = int(input("""
Enter 1: Push
2: Pop
3: Display
4: Exit
: """))
if iChoice == 1:
iArr.append(int(input("Enter the No:")))
elif iChoice == 2:
if len(iArr) == 0:
print("Array is Empty!")
else:
print("""
¯¯|
%s| is Deleted
__|""" %iArr[0])
iArr.pop(0)
elif iChoice == 3:
for i in range(0, len(iArr)):
if i == len(iArr)-1:
print("¯¯", end="")
else:
print("¯¯|", end="")
print("")
for i in range(0, len(iArr)):
if i == len(iArr)-1:
print("%s"%iArr[i], end="")
else:
print("%s|"%iArr[i], end="")
print("")
for i in range(0, len(iArr)):
if i == len(iArr)-1:
print("__", end="")
else:
print("__|", end="")
elif iChoice == 4:
break
else:
print("Please Enter a correct choice")