Design a function @ordena3(a, b, c)@ which, given three values
returns them sorted. This function must be solved with all necessary
if analyzing all possible cases: when
is greater than
and
,
when
is greater than
and
,
and so on.
Design a function @ordena2(a, b)@ that given two values returns them sorted.
Design a function @ordena3_2a2(a, b, c)@ that given three values
returns them sorted. This function cannot contain any
if and must be solved calling function
@ordena2(a, b)@ from previous point.
The first two points are worth 30 points. The last one is worth 40 points.
>>> ordena3('c', 'b', 'a') ('a', 'b', 'c') >>> ordena3(1, 2, 1) (1, 1, 2) >>> ordena2('d', 'b') ('b', 'd') >>> ordena2(1, 1) (1, 1) >>> ordena3_2a2('c', 'b', 'a') ('a', 'b', 'c') >>> ordena3_2a2(1, 2, 1) (1, 1, 2)