forked from mouredev/roadmap-retos-programacion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjptxaya.py
85 lines (68 loc) · 1.93 KB
/
jptxaya.py
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#PILAS Y COLAS
#PILAS
#Last Input First Output
my_list = [10,20,30,40]
my_list.append(50)
my_list.append(60)
#LIFO
my_list.pop()
print(my_list)
#COLAS
#First Input First Output
my_list = [10,20,30,40]
my_list.append(50)
my_list.append(60)
##FIFO
my_list.pop(0)
print(my_list)
print("DIFICULTAD EXTRA")
print("#######Navegacion########")
def navegador_web():
my_navigation = []
my_back_urls=[]
while True:
print("Selecciona la opcion:")
print("1-Navegar a url")
print("2-Adelante")
print("3-Atras")
print("4-Salir")
option = input("Selecciona la opcion:")
match option:
case "4":
break
case "1":
url_actual = input("Introduce la url:")
my_navigation.append(url_actual)
case "2":
if len(my_back_urls) > 0:
my_navigation.append(my_back_urls.pop())
case "3":
if len(my_navigation) > 0:
my_back_urls.append(my_navigation.pop())
if len(my_navigation) > 0:
print(f"URL actual: {my_navigation[len(my_navigation)-1]}")
else:
print(f"URL actual: None")
navegador_web()
print("#######Impresion########")
def impresion():
my_prints = []
while True:
print("Selecciona la opcion:")
print("1-Introducir documento")
print("2-Imprimir")
print("3-Salir")
option = input("Selecciona la opcion:")
match option:
case "3":
break
case "1":
doc = input("Introduce el documento:")
my_prints.append(doc)
case "2":
if len(my_prints) > 0:
print(f"Imprimiendo documento.... {my_prints.pop(0)}")
print("Documento impreso")
else:
print("No existen documentos para imprimir")
impresion()