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 teacher determines student percentages in a course as the points a student earns divided by the total points available in the
Ainat [17]
I think it will be E
8 0
3 years ago
Angela recently purchased a new Android smartphone. While purchasing the phone, Angela was told that she would need to set up a
Y_Kistochka [10]

Answer:

A

Explanation:

When you purchase an Android phone, it is common practice that you are required to set up your mail for the new phone to make certain functions and applications work properly.

The B option Mail will not be needed for Angela and the other mentioned options are not standard email providers.

7 0
3 years ago
Software is the brain of computer. Explain this starement
Annette [7]

here you go

i hope this helps you

5 0
3 years ago
What is one thing we should avoid doing when summarizing a storyline or event in a review?
Rashid [163]
Don't use the same words in the passage or story
6 0
3 years ago
Question 1 :George, a user, is having trouble connecting to network resources, including shared folders on the local network and
vazorg [7]

Complete Question:

George, a user, is having trouble connecting to network resources, including shared folders on the local network and Internet resources. Yesterday he was able to connect with no problems. You need to ensure that he can connect to these resources. Which tool should you use FIRST?

Group of answer choices

A. ipconfig

B. Device Manager

C. My Network Places

D. Control Panel

Answer:

A. ipconfig

Explanation:

As a network administrator, to ensure that George can connect to the network resources, shared folders, and internet resources, the tool you should use first is the "ipconfig" in the command line. This is a troubleshooting process that would help to identify the problem and to establish a theory of probable cause.

<em>Since George could connect the previous day without any problem, it is most likely that the TCP/IP settings has been altered. Therefore, to view this settings you'll have to use an ipconfig command. </em>

4 0
4 years ago
Other questions:
  • Which element in Access is an ideal data source?
    12·2 answers
  • What is used in computers to communicate with wireless keyboards, mice, and printers?
    8·1 answer
  • NEED HELP ASAP! BRAINLIEST AND 20 PTS TO CORRECT ANSWER!
    14·1 answer
  • In Java please:Re-type the code and fix any errors. The code should convert non-positive numbers to 1. if (userNum &gt; 0) Syste
    10·1 answer
  • HELP PLEASE ASAP!!! Does anyone know how to fix a broken iPhone which when I connect it to the charger it comes up with the Appl
    5·1 answer
  • In the past, data was transferred from OTLP databases to data warehouses periodically, say once a month or even once a week. Now
    11·1 answer
  • .input devices are pieces of equipment that are used to put data into the computer true or false​
    13·1 answer
  • Pls help me thx would really help me
    9·2 answers
  • What is meant by a control plane that is based on logically centralized control? In such cases, are the data plane and the contr
    8·1 answer
  • True or false. A plug-in card is always required to support pc sound
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!