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
The type of operating system best suited to controlling a massive multiplayer online game is _____.
Nina [5.8K]

Answer:

Distributed

Explanation:

5 0
3 years ago
Any two differences between third and fourth generation of computer
Setler [38]

Answer:

Third generation computer use integrated circuit(IC) and it was fast and reliable.

Forth generation computer micro computer were introduced and they were highly reliable and fast.

5 0
2 years ago
Read 2 more answers
Powerpoint increased the weight of a line in ____ increments.
USPshnik [31]
<span>One-fourth increments</span>
4 0
3 years ago
When your purchases are swiped over the bar-code reader at the point-of-sale terminals at Wal-Mart, a _____ records the data.
nydimaria [60]

Answer: Transaction processing system

Explanation:

A transaction processing system basically records all the data in the system. It is the set of data that basically monitor all the transaction process in the system. It basically perform various transaction oriented applications in the system.

It also allow time delay in the system when the item is supposed to being sold to the actually selling of the item. There are basically various types of transaction processing system arr payroll, account payable and the inventory control.

4 0
3 years ago
What is a dashed line showing where a worksheet will be divided between pages when it prints?
barxatty [35]
The answer is A. A split box
7 0
3 years ago
Read 2 more answers
Other questions:
  • Trevor got home from work and suddenly realized that he needed to edit a certain file stored in the company network's server. ho
    11·1 answer
  • Which component is the smallest unit in a spreadsheet?
    14·2 answers
  • What key is used to create spaces between lines within a document?
    8·1 answer
  • What are the two main components on the motherboard?
    12·2 answers
  • (In C prog.) What is the difference between scanf, getche and getchar?
    12·1 answer
  • You may see the term FAQ on websites which stands for Frequently Asked Questions this is an example of which type of mnemonic?
    9·1 answer
  • Which search engine do you prefer? Why
    15·2 answers
  • The incandescent test lamp is used to check for the presence of
    6·1 answer
  • To create a program in Scratch, you need to think systematically about the order of steps. This is known as
    11·1 answer
  • What is the answer for this
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!