Reference no: EM132184049
Define a function twoMaxs(..) which receives a list (lst) with at least 2 elements, containing not repeated positive integer numbers and returns a string representing the two highest numbers in the list (and respective positions in the list) as follows.
twoMaxs([10,50,20,30,80,20]) should return "80(4)--50(1)--" because 80 is the first maximum (in position 4) and 50 is the second maximum in position 1
Notice that the largest maximum is placed first.
As an example, the following code fragment:
res = twoMaxs([10,50,20,30,80,20])
print(res)
should produce the output:
80(4)--50(1)--
Language- python