Skip to content

Commit 50a1448

Browse files
committed
Se resolvió el reto
1 parent 4db78dd commit 50a1448

File tree

1 file changed

+85
-0
lines changed
  • Roadmap/50 - PLANIFICADOR DE OBJETIVOS DE AÑO NUEVO/python

1 file changed

+85
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import pandas as pd
2+
3+
print('''\n
4+
#=======================================================================================================================
5+
# 50 - Planificador de objetivos de año nuevo
6+
#=======================================================================================================================
7+
''')
8+
9+
print('''
10+
Te ayudaré a planificar tus objetivo para el nuevo año.
11+
12+
Tus objetivos deben seguir el siguiente modelo:
13+
- Meta: Leer libros
14+
- Cantidad: 12
15+
- Unidades: libros
16+
- Plazo (en meses): 12 (máximo 12)
17+
18+
Por favor ingresa la información necesaria y sigue las indicaciones:
19+
''')
20+
21+
objectives = pd.DataFrame()
22+
count = 0
23+
24+
while count <= 10:
25+
26+
count += 1
27+
28+
if count > 10:
29+
print('Has ingresado el numero maximo de objetivos.')
30+
break
31+
32+
print(f'''
33+
Ingresa informacion del objetivo {count}:
34+
''')
35+
36+
objective = {}
37+
38+
objective['Meta'] = [input('Nombre de la meta: ')]
39+
objective['Cantidad'] = [int(input('Cantidad: '))]
40+
objective['Unidad'] = [input('Unidad de medida: ')]
41+
objective['Plazo'] = [int(input('Plazo: '))]
42+
43+
objectives = pd.concat([objectives, pd.DataFrame(objective)], ignore_index=True)
44+
45+
action = int(input('''
46+
Para ingresar el siguiente objetivo digita 0.
47+
Para terminar digita 1.
48+
'''))
49+
50+
if action > 0:
51+
break
52+
53+
objectives['Frecuencia'] = objectives['Cantidad'] / objectives['Plazo']
54+
55+
mounths = ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Setiembre','Octubre','Noviembre','Diciembre']
56+
57+
mounth_num = 0
58+
59+
text = ''
60+
61+
for mounth in mounths[:objectives['Plazo'].max()]:
62+
63+
mounth_num += 1
64+
65+
text += f'\n{mounth}:'
66+
67+
for index, row in objectives.iterrows():
68+
if mounth_num <= row['Plazo']:
69+
text += f'\n{index+1}. {objectives['Meta'][index]} ({objectives['Frecuencia'][index]} {objectives['Unidad'][index]}/mes): Total: {objectives["Cantidad"][index]}'
70+
else:
71+
pass
72+
73+
print(f'\nFelicidades, aquí tienes tu planificación de objetivos:\n{text}')
74+
75+
save = input('\n¿Desea exportar su planificación (SI/NO)?: ').upper()
76+
77+
if save == 'SI':
78+
with open("planificacion_2025.txt", "w") as archivo:
79+
archivo.write(text)
80+
81+
print('Archivo exporta exitosamente ¡Adios!')
82+
83+
else:
84+
print('\nNo hay problema ¡Adios!')
85+

0 commit comments

Comments
 (0)