Usuario:Fernando~eswikibooks/ejercicio 43

De Wikilibros, la colección de libros de texto de contenido libre.



== Programación Algorítmica==[editar]



Problemas 4[editar]

ejercicio 4.3

Dados 3 números deducir cual es el central

#CONTRATO: central (real, real, real -> real)
#PROPÓSITO: 

#DEFINICIÓN:Dados 3 números deducir cual es el central

def central (x,y,z):
	if x>y and x<z or x<y and x>z:
		return x
	if y>x and y<z or y<x and y>z:
		return y
	if z>x and z<y or z<x and z>y:
		return z

#EJEMPLO:
>>>central (9,5,4)
5

.