
Problemas con la ejecucion programa python 3.4.0
Publicado por Wilder Camilo Castro (6 intervenciones) el 26/02/2016 04:13:13
Buenas noches, estoy tratando de crear un programa que le pida al usuario tres numeros reales cualquiera y arroje el menor, pero no me ejecuta el programa, por favor ayuda!
El error que me sale dice asi:
Traceback (most recent call last):
File "C:/Users/Desktop/programa1_1.py", line 11, in <module>
if a < b and a < c:
NameError: name 'a' is not defined
>>>
gracias
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
def main ():
print ("¿Cual es el numero menor? "),
a = float (input ("Ingrese el primer numero: "))
b = float (input("Ingrese el segundo numero: "))
c = float (input("Ingrese el tercer numero: "))
if a < b and a < c:
print (a)
elif b < a and b < c:
print (b)
elif c < a and c < b:
print (c)
elif a == b and a < c:
print (a , b)
elif a == c and a < b:
print (a , c)
elif b == c and b < a:
print (b , c)
else:
print (a , b , c)
El error que me sale dice asi:
Traceback (most recent call last):
File "C:/Users/Desktop/programa1_1.py", line 11, in <module>
if a < b and a < c:
NameError: name 'a' is not defined
>>>
gracias
Valora esta pregunta


0