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 commands would you use to start the program Main with four strings? a. java Main arg0 arg1 arg2 arg3 b. j
kirill [66]

Answer:

The answer is a. java Main arg0 arg1 arg2 arg3

Explanation:

The strings here are called command line argument. These command line arguments allow you to run your program from your terminal/command line. You may think just like passing parameters to a function. Since you have four strings in your program, you need to pass four arguments.

5 0
4 years ago
A _____ is an Access database object that allows you to arrange the fields of a record in any layout so you can enter, edit, and
MrRissso [65]

A form is an access database object that allows you to arrange the fields of a record in any layout so you can enter, edit, and delete records.

4 0
3 years ago
Please help me!! 10 Points are waiting!!
prisoha [69]

Google

https://google.com

Google has a large index of keywords and where those words can be found. Google uses a trademarked algorithm called PageRank, which assigns each Web page a relevancy score.

3 0
3 years ago
By generating and delivering timely and relevant information supported by networks, _____ creates new opportunities for conducti
castortr0y [4]

Answer:

The correct option to the following question is option (B). e-business.

Explanation:

E-business is stands for the Electronic business.

E-business is the business which is conduct by the uses of the internet, Web, extranet or intranet, etc.

E-business is also known as the online business where online transactions take place.

E-business facilitates our customers that the selling and the buying of the goods between the consumers and the merchants.

7 0
4 years ago
How do you italicise, bold, letters on this app?​
maks197457 [2]

Answer:

You cant on the app

Explanation:

You cannot make your text bold, <em>italic, </em><u>or underlined</u> on the Brainly App. You can only do so on the brainly.com website

5 0
3 years ago
Read 2 more answers
Other questions:
  • What is the type of account and normal balance of allowance for uncollectible accounts?
    13·2 answers
  • Which of the following best defines natural selection?
    8·1 answer
  • In a relational database, the three basic operations used to develop useful sets of data are:
    10·1 answer
  • The structure of a language has five different components: __________ refers to the smallest unit of meaning in a language, wher
    12·1 answer
  • How do computers read zeroes and ones?
    7·1 answer
  • Which changes should be made to establish and maintain formal writing conventions? Select two options.
    10·1 answer
  • &gt;What is the output of the following code:
    5·1 answer
  • Why do you think it is important to know typography and color when designing web sites?
    15·2 answers
  • Help fast fast anyone
    10·1 answer
  • Please help me to creat flow chart​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!