-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack_size.py
More file actions
64 lines (59 loc) · 1.82 KB
/
stack_size.py
File metadata and controls
64 lines (59 loc) · 1.82 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
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'
stack = creating_stack.stack_return()
# process
def stack_size_implement():
if stack == []:
print(style.RED + "Your stack size is 0 it mean it doesn't contain any element.")
input("Enter any key to close: ")
stack_size()
else:
stack_size_imp = len(stack)
print(style.RED + "The size of your stack is " + str(stack_size_imp) + " .")
input("Enter any key to close")
stack_size()
# review
def stack_size_review():
print(style.WHITE +"""
# process
def stack_size_implement():
if stack == []:
print(style.RED + "Your stack size is 0 it mean it doesn't contain any element.")
input("Enter any key to close: ")
else:
stack_size_imp = len(stack)
print(style.RED + "The size of your stack is " + str(stack_size_imp) + " .")
input("Enter any key to close")
stack_size()
""")
input(style.RED + "Enter any key to close: ")
stack_size()
def stack_size():
print(style.YELLOW + """
[+] Check the size of your created stack:
1: Created stack size
2: code review
3: back
""")
selection = input("Enter your selection: ")
if selection == '1':
stack_size_implement()
elif selection == '2':
stack_size_review()
elif selection == '3':
stack_implementation.stack_implementaion()
else:
print(style.RED + "[+] invalid input try again!")
stack_size()