You've already forked Curso-lenguaje-python
Restructure content and add notes from HolaMundo
Signed-off-by: Manuel Vergara <manuel@vergaracarmona.es>
This commit is contained in:
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
BIN
python-total/doc_curso/08_consola_de_turnos/076Pylint.pdf
Normal file
BIN
python-total/doc_curso/08_consola_de_turnos/076Pylint.pdf
Normal file
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
def Sumar(número1, número2):
|
||||
return número1+número2
|
||||
|
||||
suma = Sumar(5,7)
|
||||
print(suma)
|
||||
@@ -0,0 +1,20 @@
|
||||
'''
|
||||
Este módulo contiene una sencilla función de suma,
|
||||
y ejecuta un ejemplo mostrando el resultado en pantalla
|
||||
'''
|
||||
|
||||
|
||||
def sumar(numero1, numero2):
|
||||
|
||||
"""
|
||||
Esta función recibe dos argumentos numéricos
|
||||
y devuelve su suma
|
||||
"""
|
||||
|
||||
return numero1 + numero2
|
||||
|
||||
|
||||
SUMA = sumar(5, 7)
|
||||
|
||||
|
||||
print(f'El resultado de la suma fue: {SUMA}')
|
||||
BIN
python-total/doc_curso/08_consola_de_turnos/079Unittest.pdf
Normal file
BIN
python-total/doc_curso/08_consola_de_turnos/079Unittest.pdf
Normal file
Binary file not shown.
BIN
python-total/doc_curso/08_consola_de_turnos/080Decoradores.pdf
Normal file
BIN
python-total/doc_curso/08_consola_de_turnos/080Decoradores.pdf
Normal file
Binary file not shown.
BIN
python-total/doc_curso/08_consola_de_turnos/081Generadores.pdf
Normal file
BIN
python-total/doc_curso/08_consola_de_turnos/081Generadores.pdf
Normal file
Binary file not shown.
Binary file not shown.
32
python-total/doc_curso/08_consola_de_turnos/083numeros.py
Normal file
32
python-total/doc_curso/08_consola_de_turnos/083numeros.py
Normal file
@@ -0,0 +1,32 @@
|
||||
def numeros_perfumeria():
|
||||
for n in range(1, 10000):
|
||||
yield f"P - {n}"
|
||||
|
||||
|
||||
def numeros_farmacia():
|
||||
for n in range(1, 10000):
|
||||
yield f"F - {n}"
|
||||
|
||||
|
||||
def numeros_cosmetica():
|
||||
for n in range(1, 10000):
|
||||
yield f"C - {n}"
|
||||
|
||||
|
||||
p = numeros_perfumeria()
|
||||
f = numeros_farmacia()
|
||||
c = numeros_cosmetica()
|
||||
|
||||
|
||||
def decorador(rubro):
|
||||
|
||||
print("\n" + "*" * 23)
|
||||
print("Su número es:")
|
||||
if rubro == "P":
|
||||
print(next(p))
|
||||
elif rubro == "F":
|
||||
print(next(f))
|
||||
else:
|
||||
print(next(c))
|
||||
print("Aguarde y será atendido")
|
||||
print("*" * 23 + "\n")
|
||||
34
python-total/doc_curso/08_consola_de_turnos/084principal.py
Normal file
34
python-total/doc_curso/08_consola_de_turnos/084principal.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import numeros
|
||||
|
||||
def preguntar():
|
||||
|
||||
print("Bienvenido a Farmacia Python")
|
||||
|
||||
while True:
|
||||
print("[P] - Perfumería\n[F] - Farmacia\n[C] - Cosmútica")
|
||||
try:
|
||||
mi_rubro = input("Elija su rubro: ").upper()
|
||||
["P", "F", "C"].index(mi_rubro)
|
||||
except ValueError:
|
||||
print("Esa no es una opción válida")
|
||||
else:
|
||||
break
|
||||
|
||||
numeros.decorador(mi_rubro)
|
||||
|
||||
|
||||
def inicio():
|
||||
|
||||
while True:
|
||||
preguntar()
|
||||
try:
|
||||
otro_turno = input("Quieres sacar otro turno? [S] [N]: ").upper()
|
||||
["S", "N"].index(otro_turno)
|
||||
except ValueError:
|
||||
print("Esa noes una opción válida")
|
||||
else:
|
||||
if otro_turno == "N":
|
||||
print("Gracias por su visita")
|
||||
break
|
||||
|
||||
inicio()
|
||||
Reference in New Issue
Block a user