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

  Create and populate a linkedlist

Create and populate a LinkedList using a one dimensional array. Add 6 numbers to this LinkedList. Search this LinkedList and find the smallest number.

  Show if G does not have a self-embedding non-terminal

Show that, if G does not have a self-embedding non-terminal, then it is regular.

  Calculate y at equilibrium

Assume: C = 40 + 0.8(Y - T) G = 10 I = 20 T = 10, where T are taxes.

  Designing cryptographic protocols

For each, give an example where their principle applies and results in an improved protocol.

  Find the sum of all the elements of the lists

The first function you will write should be called ‘sumNumbers'. Your function should take three input variables, each one an integer between 0 and 100.

  Explain a some optimization techniques

Explain a some optimization techniques (at least 4) you would like to remember in future programming course? How would they help you in writing a better code?

  Change margins vertical alignment and font and font size

Change margins, vertical alignment, line spacing, and font and font size, and delete blank lines. Set tab stops using the ruler to line up information. Set tab stops and add leaders to create lines for users to fill in information.

  Fbi says fewer than 25 failed polygraph test

The article "FBI Says Fewer than 25 Failed Polygraph Test" (San Luis Obispo Tribune, July 29, 2001) states that false-positives in polygraph

  Use of social networking such as facebook

How does the use of social networking such as Facebook, Twitter, Instagram, blogs and other such sites align with your biblical worldview of computer technology?

  Question regarding the performance improvement

Why are accreditation, certification, and licensure important for the health care facility? In your response explain the performance improvement perspectives of accreditation, certification, and licensure of the organizations. Be sure to justify y..

  What methods do you generally use to find a speech

Do you have trouble deciding on a topic? Have you used any of the techniques discussed in this week's lesson, or do you plan to try one?

  Unexpected events including network security event

"Disaster recovery plans in case of earthquakes, fires, hurricanes, asteroids that collide with satellites, or other natural or man-made disasters." Many companies have a "risk action plan" to handle unexpected events including network security ev..

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