1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Pie
3 years ago
12

Given the lists, lst1 and lst2, create a new sorted list consisting of all the elements of lst1 that also appears in lst2. For e

xample, if lst1 is [4, 3, 2, 6, 2] and lst2 is [1, 2, 4], then the new list would be [2, 2, 4]. Note that duplicate elements in lst1 that appear in lst2 are also duplicated in the new list. Associate the new list with the variable new_list, and don't forget to sort the new list.
Mathematics
1 answer:
aalyn [17]3 years ago
8 0

Answer:

lst1 = [4, 3, 2, 6, 2]

lst2 = [1, 2, 4]

new_lst =  []

for i in lst1:

      if i in lst2:

           new_lst.append(i)

new_lst.sort()

print(new_lst)

Step-by-step explanation:

The code is written in python.

lst1 = [4, 3, 2, 6, 2]

The variable lst1 represent a list of integers.

lst2 = [1, 2, 4]

The variable lst2 represent a list of integers.

new_lst =  []

An empty variable is created new_lst and it is used to store the values of lst1 that is in lst2.

for i in lst1:

The code loop through integers in lst1.

if i in lst2:

This code means if any of the value in lst1 is in lst2.

new_lst.append(i)

This code put the same values found in lst1 and lst2 in a new list(new_lst)

new_lst.sort()

We sort the value of the new list from the smallest to the biggest.

print(new_lst)

The new list is displayed

You might be interested in
2. The original price of a T.V. is $1,100. During a Christmas sale, the T.V. is discounted 20%. What is the final price of the T
gtnhenbr [62]

Answer:

888 if you pay, and savings is 222

Step-by-step explanation:

5 0
4 years ago
What is 2,069 is in the written
777dan777 [17]

Answer:

2.069x10^3

Step-by-step explanation:

Move the decimal places.

8 0
4 years ago
Which equation represents a parabola that opens upward has a minimum at x=3 and has a line of symmetry at x=3
umka2103 [35]

Answer:

y=x^2-6x+5

Step-by-step explanation:

Let us consider the equation y=x^2-6x+5

For a quadratic equation in a standard form, y=ax^2+bx+c, the axis of symmetry is the vertical line x = \frac{-b}{2a}.

Here in this case we have, a=1, b=-6 , c =5

Putting the values we get,

x = \frac{-(-6)}{2\times 1} = \frac{6}{2} =3

We can see that the axis of symmetry is x=3 and the graph is giving minimum at x=3.

Therefore, the required equation is y=x^2-6x+5. Refer the image attached.


4 0
3 years ago
Read 2 more answers
Mara works in a music store and has a guitar on sale for 35% off. The guitars regular price is $630, what is the sale price?
lapo4ka [179]

Answer:

dfghfegfefehfgfe

Step-by-step explanation:

tyfvrfvewfgwvehgew e

3 0
3 years ago
Based only on the information given in the diagram, which congruence theorems or postulates could be given as reasons why HEL PM
nalin [4]
Please be a little more specific on what you want to ask.
I can be of some help.
6 0
3 years ago
Other questions:
  • What percentage of people has an IQ score between 60 and <br> 140​?
    15·1 answer
  • Dana is attaching a shelf to a wall and needs the shelf to be perpendicular to the wall. How many degrees should the shelf be re
    6·1 answer
  • What is this and what is the answer 9a + 10(6a-1)
    12·1 answer
  • Please answer this thank you really appreciate it
    5·1 answer
  • James has a piece of constrution paper with area of 65 1/4 inches . It is 9 2/3 inches long. What is the width of the piece of c
    13·1 answer
  • What are the features of the function f(x) = –2 (2)x + 4 graphed below?
    9·1 answer
  • The gross monthly salary of a permanent secretary is $6,583. Find his net annual salary after deductions of $1,475 were made mon
    13·1 answer
  • Virginia had 3600 dollars in her saving account. She withdrew 2/5 of the money and donated 1/2 of this to the orphanage. How muc
    5·1 answer
  • Question<br> Which ordered pairs are solutions to the equation 5x + 6y = 13?
    11·1 answer
  • Given the equation 5x - 7 = 18. What is
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!