-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack_empty.py
More file actions
68 lines (61 loc) · 1.76 KB
/
stack_empty.py
File metadata and controls
68 lines (61 loc) · 1.76 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import os
import stack_implementation
import creating_stack
class style():
BLACK = '\033[30m'
RED = '\033[31m'
GREEN = '\033[32m'
YELLOW = '\033[33m'
BLUE = '\033[34m'
MAGENTA = '\033[35m'
CYAN = '\033[36m'
WHITE = '\033[37m'
UNDERLINE = '\033[4m'
RESET = '\033[0m'
# process
def stack_is_empty():
stack = creating_stack.stack_return()
if stack == []:
print(style.RED + "Your stack is empty")
input("Enter any key to close: ")
stack_empty()
else:
print(style.RED + "Your stack is full.")
input("Enter any key to close: ")
stack_empty()
# code review
def stack_empty_review():
print(style.WHITE + """
# process
stack = creating_stack.stack_creation()
def stack_is_empty():
if stack == []:
print("Your stack is empty")
stack_empty()
else:
print("Your stack is full.")
stack_empty()
""")
back_selection = input(style.RED +"""Enter any key to close: """)
if back_selection == '0':
stack_empty()
else:
stack_empty()
def stack_empty():
print(style.YELLOW + """
[+] Select an option if you didn't create stack before the process will return that stack is empty
otherwise it will return that stack is full.
1: stack is_empty check
2: code review
3: back
""")
selection = input("Enter your selection: ")
if selection == '1':
stack_is_empty()
elif selection == '2':
stack_empty_review()
elif selection == '3':
stack_implementation.stack_implementaion()
else:
print(style.RED + "[+] invalid input try again!")
stack_empty()