UTILIZACION DE FUNCIONES
Publicado por Rodi (9 intervenciones) el 30/09/2020 13:43:18
Hola amigos, tengo este código que me arroja un error de "NO DEFINIDO", quien me puede aclárame el porque y cual seria la solución, gracias
Se produjo una excepción: NameError
name 'esmoneda' is not defined
File "D:\01. RODY_A\NEXT_U\1.2. CARRERA DE DESARROLLADOR WED\A. FUNDAMENTOS DE PROGRAMACION EN PYTHON\3. Estructuras de Control\5. Leccion 4_Funciones en Python\5. Ejercicio01_file_Funciones\PYT18S_C1U3L4_Ejercicio1_Funciones_Python_V1.py", line 5, in <module>
if esmoneda():
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
total=0
i=0
while (i < 3):
cripto = input("Ingrese el nombre de la moneda: ")
if esmoneda():
i=i+1
cant = ""
while not esnumero(cant):
cant = input("Indique la cantidad de "+cripto+":")
cotiz=""
while not esnumero(cotiz):
cotiz = input("Indique la cotización en USD de "+cripto+":")
total = total + float(cant) * float(cotiz)
else:
print("Moneda invalida.")
print("El tota en USD que tiene el usuario es de ",str(total))
def esmoneda(cripto):
criptos = ["BTC","BCC","LTC","ETH","ETC","XRP"]
if cripto in criptos:
return True
else:
return False
def esnumero(numero):
return numero.replace('.','',1).isdigit()
Se produjo una excepción: NameError
name 'esmoneda' is not defined
File "D:\01. RODY_A\NEXT_U\1.2. CARRERA DE DESARROLLADOR WED\A. FUNDAMENTOS DE PROGRAMACION EN PYTHON\3. Estructuras de Control\5. Leccion 4_Funciones en Python\5. Ejercicio01_file_Funciones\PYT18S_C1U3L4_Ejercicio1_Funciones_Python_V1.py", line 5, in <module>
if esmoneda():
Valora esta pregunta
0