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
-Dominant- [34]
3 years ago
5

write a function deal3 of type 'a list -> a' list whose output list is the same as the input list, but with the third element

deleted.
Computers and Technology
1 answer:
qwelly [4]3 years ago
8 0

Answer:

I am writing a python program for this.  

  def deal3(input_list, index):  

   list = []    

   for x in range(len(input_list)):            

       if x != index:  

           list.append(input_list[x])  

   print('list ->',list)      

input_list = [10, 20, 30, 40, 50]  

index = 2

deal3(input_list, index)

Explanation:

  • The first line of code defines a function deal3 which has two parameters. input_list which is an input list and index is the position of elements in the input list.
  • next statement list=[] declares a new list that will be the output list.
  • next statement for x in range(len(input_list)):   is a loop which the loop variable x will traverse through the input list until the end of the input list is reached.
  • the next statement if x != index:  checks if x variable is equal to the position of the element in the list.
  • Next statement list.append(input_list[x]) appends the elements of input list to list( new list that will be the output list). Now the output list will contain all the elements of the input list except for the element in the specified position (index variable).
  • this statement print('list ->',list) prints the list (new output list).
  • this statement input_list = [10, 20, 30, 40, 50]  insert elements 10 20 30 40 50 in the input list.
  • index=2 specifies the second position (3rd element) in the list that is to be removed.
  • deal3(input_list, index) So the function is called which will remove 3rd element of the input list and prints output array with same elements as that in input array except for the element at the specified position.

You might be interested in
A student is taking a computer course in which there will be four​ tests, each worth 100 points. The student has scores of 92​,
MissTica

Answer:

He must score 86 or more in the fourth test to get and A

Explanation:

The needed score can be found with this equation

(92+88+94+x) = 360

274 + x =360

x = 360 - 274

= 86

x represents the fourth score, the sum of the four scores must be up-to 360 for the student to get an A

7 0
3 years ago
g Consider a TCP connection between Host A and Host B. Suppose that the TCP segments traveling from Host A to Host B have source
Inga [223]

Answer:

Source port number and destination port numbers for segment travelling from HOST B to HOST A are : Source port number is y , and Destination port number is x.

Explanation:

Because in problem statement it given that the TCP segments traveling from Host A to Host B have source port number x and destination port number y. So it is clear that that Host A has a port named x and Host B has a port named y and when segments travels from Host B to Host A the Host B's port becomes source and Host A's port becomes source.

5 0
3 years ago
A group of interrelated resources acting together according to a plan to accomplish the goals of the records and information man
Verizon [17]

Answer: Record system

Explanation:

 The record system is one of the type of information storage system that stored all the records or data in the form of management system.

  • We can also retrieve the our data or information by saving it in the system so that we can use that specific data for future use.
  • It also helps in ensuring the data integrity and providing an efficient security to our data or information in the system.

 According to the given question, record system is one of the information management system that helps in accomplished the goals in the form of record.

 Therefore, Record system is the correct answer.

8 0
4 years ago
Select the correct answer.
aleksandrvk [35]

Answer:

B.  color and painting tools

Explanation:

5 0
2 years ago
My iOS 14 homeschool not decorate its plain and looks how it was before I don’t have have to spend hours decorating I’m not crea
ella [17]

Answer:

No ONe cares about your ios 4 software

Explanation:

I just don't care

7 0
3 years ago
Other questions:
  • Given two variables hasToner and hasPaper of type bool, that have been declared and given values, write a code block that will o
    15·1 answer
  • Consider an application that transmits data at a steady rate (for example, the sender generates an N-bit unit of data every k ti
    8·1 answer
  • When activated, an Excel object has all the features of an Excel
    8·2 answers
  • A Web _a___ is a software program that retrieves the page and displays it. Select one:
    15·1 answer
  • Discuss the role that Cloud Computing plays in an organization and the potential impact that Cloud Computing has on IT.
    8·1 answer
  • Binary tree algorithm?
    5·1 answer
  • Tools used to build a bridge<br>​
    15·1 answer
  • Put these numbers in order from smallest to largest:<br> 1. 00101112<br> 2. 011110<br> 3. 011110112
    12·2 answers
  • 1. provides a list of at least five SSIDs and the
    15·1 answer
  • How do I fix when it hits the second session it skips scanf..
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!