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
Which of the following pathways relates to the Architecture and construction career cluster
Murrr4er [49]
*Design/Pre-Construction
*Construction
*Maintenance/Opreations
5 0
4 years ago
if your audience seems confused about a previous slide, in presenter view, whats the best way to jump back to a previous point i
SOVA2 [1]

Answer:

You can go back to that point towards the end of the presentation  or find where it would link later on in the presentation. Then you can ask if there are any questions and if the audience are willing to ask them you can go ahead and explain it.

Explanation:

8 0
3 years ago
Hey yall! Its spoopy season! I am having a live stream on the Spoon app under the username teendragonqueen️‍ if yall wanna join!
Aleks [24]

Answer:

Ok sounds cool.

Explanation:

3 0
4 years ago
Read 2 more answers
An administrator needs to protect rive websites with SSL certificates Three of the websites have different domain names, and two
Marysya12 [62]

Answer:

Option A (One SAN certificate) is the right answer.

Explanation:

  • A vulnerability management certificate that permits many domain identities to be safeguarded by such a singular or unique certification, is considered a SAN certificate.
  • Though on the verge of replacing common as well as accepted security credentials with either of these de-facto certifications.

Other alternatives are not connected to the given scenario. Thus the above option is correct.

5 0
3 years ago
You have just installed a network adapter and have booted up the system, installing the drivers. You open Windows Explorer on a
Tamiku [17]

Answer:

C. Are the lights on the adapter functioning correctly

Explanation:

When a Network Interface Card is installed and your computer is not showing anything, the first thing you need to check the light on the adapter in order to ensure connectivity. The Network Interface Card will not work even if the network adapter is turned on but not getting any power.

8 0
4 years ago
Other questions:
  • Radio waves pros and cons
    10·2 answers
  • Which statement is unnecessary inside the unit test for the custom controller?
    9·1 answer
  • Flesh out the body of the print_seconds function so that it prints the total amount of seconds given the hours, minutes, and sec
    12·1 answer
  • What does gps stand for ?
    15·2 answers
  • What is Administrator windows 10
    8·1 answer
  • How do i end my current plan that i never signed up for, the basic one it charged me $24
    11·2 answers
  • PLS ANSWER QUICK!!!!
    12·1 answer
  • Write a program that accepts a file name from the command line, then initializes an array with test data using that text file as
    6·1 answer
  • What is one way object-oriented programming differs from procedural programming?
    15·1 answer
  • Create a program that a professor can use to display a grade for any number of students. Each student's grade is based on four t
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!