write a Python program to find a list of integers with exactly two occurrences of nineteen...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
write a Python program to find a list of integers with exactly two occurrences of nineteen and at least three occurrences of five. Use at least 2 lists to test your logic. [19, 19, 15, 5, 3, 5, 5, 2] [19, 15, 15, 5, 3, 3, 5, 2] Output should be True or False with a count of occurrences of each number. Question 2: write a Python program to find the longest string of a given list of strings. Print the original list and the result you received. Use both lists below (run each list through your code, print the result, then move on to the next list). Input: ['cat', 'car', 'fear', 'center"] Input: ['cat', 'dog', 'shatter', 'donut', 'at', 'todo", "] write a Python program to find a list of integers with exactly two occurrences of nineteen and at least three occurrences of five. Use at least 2 lists to test your logic. [19, 19, 15, 5, 3, 5, 5, 2] [19, 15, 15, 5, 3, 3, 5, 2] Output should be True or False with a count of occurrences of each number. Question 2: write a Python program to find the longest string of a given list of strings. Print the original list and the result you received. Use both lists below (run each list through your code, print the result, then move on to the next list). Input: ['cat', 'car', 'fear', 'center"] Input: ['cat', 'dog', 'shatter', 'donut', 'at', 'todo", "]
Expert Answer:
Answer rating: 100% (QA)
Question 1 Answer You can achieve this by first counting the occurrences of each number in the list ... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
how according to ehrenreich has positive thinking contributed to recent and current american problems and catastrophes?
-
Principles of Community Engagement "Principles of Engagement, Second Edition" The fourth principle discusses "community empowerment". What does this term mean to you? Why is "empowerment" an...
-
On December 31, 2022, Akron, Incorporated, purchased 5 percent of Zip Company's common shares on the open market in exchange for $16,050. On December 31, 2023, Akron, Incorporated, acquires an...
-
Delivery Service purchased a commercial umbrella policy with a $10 million liability limit and a $100,000 self-insured retention. The umbrella insurer required Delivery Service to carry a $1 million...
-
A cable passes around three 2-in.-radius pulleys and supports two blocks as shown. Two of the pulleys are locked to prevent rotation, while the third pulley is rotated slowly at a constant speed....
-
QUESTION 8 A firms cost function is C(q)= q^2 + 4q +12 and it sells units at a price of $42 per unit. q denotes the number of units. What is the profit-maximising number of units? Type your answer to...
-
Provide three examples for open-ended and closed questions.
-
Following are the individual financial statements for Gibson and Davis for the year ending December 31, 2018: Gibson acquired 60 percent of Davis on April 1, 2018, for $528,000. On that date,...
-
1. 2. The lessee makes a lease payment of $67,200 to the lessor for equipment in an operating lease transaction. Pharoah Company leases equipment from Noble Construction Inc. The present value of the...
-
Founded in 1972, the German software business SAP (Systems, Applications, and Products in Data Processing) is known as one of the world leaders in enterprise resource planning software, employing...
-
Identify 3 additional local creative residents in Las Vegas from the past and present, whose work could potentially be displayed at the library.
-
Develop state space model for each of the electrical networks shown below. Investigate if each one of them is completely controllable and/or completely observable. Substantiate the result with...
-
Develop state space model for the system with signal flow graph shown in Fig. P7.3. R(s) o R(s) o 1 - 64 4/(s + 2) 10 2+4 1 1/(s + 1) 1 -OY, (s) -0 Y(s)
-
The block diagram of a system together with state variable assignment as labelled therein, is shown in Fig. P7.12. Test controllability and observability. Comment on test result. U 3 1 s+2 1 S X +
-
The state-space representation in phase-variable form for the transfer function \[ G(s)=\frac{2 s+1}{s^{2}+7 s+9} \quad \text { is } \] (a) \(\dot{x}=\left[\begin{array}{rr}0 & 1 \\ -9 &...
-
The Bode \(\mathrm{dB}\) plot is shown below. The corresponding transfer function model is (a) \(\frac{10^{4}(1+j \omega)}{(10+j \omega)(100+j \omega)^{2}}\) (b) \(\frac{10^{-1}(1+j \omega)}{(10+j...
-
- Read the following case study carefully, and develop a document as required. Plan the content according to the principles covered in in the course (e.g., main idea first). Draft your document and...
-
Using the information in P11-2B, compute the overhead controllable variance and the overhead volume variance. Data From Problem 11-2B: Huang Company uses a standard cost accounting system to account...
-
The two-dimensional arrays m1 and m2 are strictly identical if their corresponding elements are equal. Write a method that returns true if m1 and m2 are strictly identical, using the following...
-
The nine tails problem in the text uses a 3 * 3 matrix. Assume that you have 16 coins placed in a 4 * 4 matrix. Write a program to find out the number of the starting patterns that dont have a...
-
A pentagonal number is defined as n(3n1)/2 for n = 1, 2, . . ., and so on. Therefore, the first few numbers are 1, 5, 12, 22, . . . . Write a method with the following header that returns a...
-
The following data sets give the approximate lengths of Beethovens nine symphonies and Mahlers nine symphonies (in minutes). Beethoven: Mahler: 28 36 50 33 30 40 38 26 68 52 85 94 50 72 72 80 90 80
-
At the Web sites of the American Lung Association and the U.S. Environmental Protection Agency, find statistical data concerning the health effects of secondhand (passive) smoke. Write a short...
-
You manage a small ice cream shop in which your employees scoop the ice cream by hand. Each night, you total your sales and the total volume of ice cream sold. You find that on nights when an...
Study smarter with the SolutionInn App