Representing the two highest numbers

Assignment Help Basic Computer Science
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

Reference no: EM132184049

Questions Cloud

Three page on organization learning disabilities : Can someone please give me a three page on organization learning disabilities?
Difficult to speak about in public : What informative speech topics are too difficult to speak about in public? Why?
Describe the jobs prior to the technological advances : Describe the jobs prior to the technological advances, List the new skills that you feel are relevant for person-focused pay programs.
Analysis of market structure and relating pricing strategies : Develop a paper detailing an analysis of market structures and relating pricing strategies that are suitable for each of these structures.
Representing the two highest numbers : Define a function twoMaxs(..) which receives a list (lst) with at least 2 elements, containing not repeated positive integer numbers and returns a string
Identify and discuss at least two of the case studys finding : Identify and discuss at least two of the case study's findings and recommendations and evaluate its strengths and weaknesses.
What quoted yield to maturity on a semiannual coupon bond : What quoted yield to maturity on a semiannual coupon bond would make you indifferent between that bond and the quarterly coupon bond described above
Second number the number of times : Define a function countALLlist(..) which receives a list of strings (where each string contains only digits) and returns a list with 10 values.
Transmission control protocol : What are the differences between Transmission Control Protocol and User Datagram Protocol? Please, also why would you use one over the other?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  The size of 2k bytes goes through a wan.

A packet with the size of 2K bytes goes through a WAN. If the packet goes through 10 store-and-forward switching/routing devices, all of which have the transmitting rate of 2Mbit/s, what is the total delay the packet experiences in this WAN? Please i..

  Requirements and assumptions for new interface design

You are to prepare the project scope and initial requirements and assumptions for a new Interface Design project for the Museum Guided Exhibition as outlined in the Museum Guided Exhibition problem case study.

  Same operation using data from main memory

Explain why a computer instruction that operates on registers is faster than the same operation using data from main memory.

  Display the amount of profit and loss

Demonstrate the function in a program that asks the user to enter the necessary data and displays the amount of the profit or loss.

  What are the essential elements of an effective report

Formal communications in business often involves crafting reports that communicate business performance and proposals that solicit approval and/or funding

  What is rule of thumb as to when a system should be replaced

All systems eventually grow old and become obsolete. What is the rule of thumb as to when a system should be replaced?

  Design and implement an algorithm

Design and implement an algorithm that accepts as input an ordered list of search names. The task required is to establish and report the absence or presence of these search names in a second much longer ordered list.

  Describe the steps in the keypad polling routine

What distinguishes a control data value from a character data value for the LCD module. Describe the steps in the keypad polling routine

  Detercounter-cyclical

Even though Federal Government spending is "counter-cyclical" why is it not necessarily the case that an improvement in the nation.

  Loop structure that continues to square the number

Obtain an integer value between 1 and 9 from a user. create a loop structure that continues to square the number until the result exceeds 1,000,000.

  Developing a design class diagram

Classes can be defined in class diagrams such as a detailed DCD. A class diagram describes the attributes and operations of each class in detail.

  Application that would have a very low cache

Can you think of an application that would have a very low cache and main memory hit rate and give an example of a very simple program whose data references demonstrate locality of reference?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd