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
Nataly_w [17]
3 years ago
6

Find the number of times a value appears in a list, and create a new list that contains the index positions where the value occu

rs in the list argument.
Computers and Technology
1 answer:
Maru [420]3 years ago
3 0

Answer:

Program :

list_1=[]#take the empty list.

size=int(input("Enter the size of the list: "))#take the size of the list from the user

for x in range(size): #for loop which insert the elemnt on the list.

   list_1.append(int(input("Enter the "+str(x+1)+" element of the list: ")))#take the user input and insert the element.

element=int(input("Enter the element to be searched: "))#it take the elemnt to search.

loc=1#intialize the location value.

count=0

for x in list_1:#for loop to check the element.

   if(x==element): #check the element.

       print(loc,end=", ")#print the location of the element.

       count=count+1

   loc=loc+1

if(count==0):

   print("The element is not present on the list")#print when elemnt are not present.

Output:

  • If the user input 5 for the size and 1,2,3,4,5 for the list and 5 for the element, then it will print 5.

Explanation:

  • The above code is in python language which is used to take the size for the list, then take the value to add on the list.
  • Then the element is entered from the user to search on the list.
  • Then the element is searched on the list with the help of for loop.
  • It prints the location when the element is matched.

You might be interested in
Given the function definition void something ( int a, int& b ) { int c; c = a + 2; a = a* 3; b = c + a; } what is the output
timurjin [86]

Answer:

1 14 3

Explanation:

If that code fragment is put under a main() function and then it will yield the above output. According to the function something(), only changes in value second parameter will be reflected and first will be unchanged because second is passed by reference and the first one is passed as value so only address of 's' is passed, so, only its value is changed and the rest are same.

8 0
3 years ago
Which focal length and aperture combination is most likely to give you a deep depth of field?
frutty [35]

Answer:

f/11 is the answer I think

3 0
3 years ago
ACL 1 has three statements, in the following order, with address and wildcard mask values as follows: 1.0.0.0 0.255.255.255, 1.1
larisa86 [58]

If a router tried to match a packet sourced from IP address 1.1.1.1 using this ACL, the first statement will be used.

a. First

<u>Explanation:</u>

We use ACL technology to make basic security level in the network.  ACL is strictly used to update the routing in the network and make sure network pears and make sure the flow control for network traffic is followed.

Since it is routing ip address through ACL statement. It all depends on how the network engineer routed the traffic in the network. A packet with source IP address 1.1.1.1 would match any of the three explicitly configured commands described in the question. As a result, the first statement will be used.

The router searches the ACL statement by order and when the match is found it stops execution of the ACL statement that will match with the first occurrence.

7 0
3 years ago
What are some cowboy ethics??
lys-0071 [83]

Answer:

giv meh a min plsssss

Explanation:

4 0
3 years ago
What is the purpose of adding a footnote or an endnote in your research paper?
lions [1.4K]
They add clarifying information to a document. They provide details the reader may be unfamiliar with, and saving them from having to look them up (words, places or sources.)
3 0
3 years ago
Other questions:
  • Question 4 (2 points)
    6·2 answers
  • he Saffir-Simpson Hurricane Scale classifies hurricanes into five categories numbered 1 through 5. Write an application named Hu
    10·2 answers
  • If i throw papers in the dryer to help them dry faster could that mess up the dryer?
    5·1 answer
  • Carlos owns a hardware store. He currently is not using any software to track what he has in the store. In 1–2 sentences, descri
    9·2 answers
  • Which online resource is usually not free?
    10·2 answers
  • Ciscon Telecom is a mobile operator in the European Union. The company provides personalized services to its customers, and its
    8·2 answers
  • How many fixes are available for Adobe Photoshop CS4 (64 Bit)?
    9·1 answer
  • Most hard drives are divided into sectors of 512 bytes each. Our disk has a size of 16 GB. Fill in the blank to calculate how ma
    9·1 answer
  • Place the steps in order for creating a Custom Search Folder in Outlook 2016.
    9·2 answers
  • Solve this for brainlest​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!