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
Which expression is equivalent to 200?<br> O 2 /10<br> O 10/2<br> O 10/20<br> O 100/13
creativ13 [48]

Answer:

10/20

Step-by-step explanation:

10 times 20 is 200 which would give you 10/20

hope I did this right

6 0
3 years ago
I need help to solve the equation
AleksAgata [21]

Answer:

D) X=-6

Step-by-step explanation:

5 0
3 years ago
I need this please help me
pshichka [43]

Answer:

s' = (3,2) t' = (2,4) u' = (1,1)

Step-by-step explanation:

can i have brainliest plz

4 0
3 years ago
Kelly can walk 8 1/3 kilometers in one hours. How far can she walk in 2 2/5 hours?
gulaghasi [49]

Answer:

20 km

Step-by-step explanation:

6 0
3 years ago
If BD = 4, AD = x-6, and CD = x, what is the length of CD?
emmainna [20.7K]

Answer:

The length of CD is 8 units

Step-by-step explanation:

<u><em>The complete question in the attached figure</em></u>

we know that

According to the Right Triangle Altitude Theorem,

(BD)^2 = (AD)(CD)

substitute the given values

(4)^2 = (x-6)(x)

16=x^2-6x\\x^2-6x-16=0

solve the quadratic equation by graphing

The solution is x=8 or x=-6

see the attached figure N 2

Discard the negative length.

therefore

The length of CD is 8 units

8 0
3 years ago
Other questions:
  • In 1908, a Model T cost $950. By 1927, Ford had become so efficient that the car's price dropped to $280. What was the percentag
    11·1 answer
  • ustin's hair is 3 1/4 inches long. How long will it be in 2 months if it grows 1/2 inch each month? Which method will NOT give t
    12·1 answer
  • (1.)Find the slope of the line that passes through the given pair of points. (If an answer is undefined, enter UNDEFINED.) (?a +
    14·1 answer
  • MARKING BRAINLIEST!
    14·1 answer
  • (15-16) Consider the Infinite Geometric Series:
    12·1 answer
  • A salesperson's weekly paycheck is 40% more than a second salesperson's paycheck. The two paychecks total $1075. Find the amount
    7·1 answer
  • Please help me on 1,2, and 3 I am taking a quiz and I do not know this
    6·1 answer
  • 24 men in a room 1/2 wearing red shirt 1/3 wearing green shirt the rest are wearing blue shirt​
    7·2 answers
  • The table of values represents a linear function g(x), where x is the number of days that have passed and g(x) is the balance in
    10·1 answer
  • A manager at a store is holding a contest where the first, ninth, and ninetieth customers of the day will win a prize. 100 peopl
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!