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
notsponge [240]
3 years ago
12

Write a prolog program to get a list and delete the first two elements of a list and the last two elements of the list and retur

ns the list without these elements For example ?- delements([a,b,c,d,e,f], Q). Q = [c,d]
Computers and Technology
1 answer:
Svetradugi [14.3K]3 years ago
3 0

Answer:

def prolog(mylist):

   for x in range(2):

       del mylist[0]

       del mylist[-1]

   return mylist

scores = [23, 23,45, 45, 65, 65]

result = prolog(scores)

Explanation:

The del keyword in python is used to delete variable and items in a data structure like in a list. To delete a list, specify the list name and also an index to delete an item.

The function 'prolog' loops through a list to delete the first and the last two items.

You might be interested in
Go to your Canvas course and locate the Assignment: Writing Prompt 1: Is the Internet making us Meaner?and complete the activity
Maslowich

Answer and Explanation:

The Internet is not changing anything other than making you extreme. The nice become nicer, the mean become meaner, the nice become mean, and the mean become nice. The internet just makes things easier to do. It really isn't a factor in if you are mean or not.

7 0
3 years ago
Read 2 more answers
I need this answer right away!
Degger [83]

Answer:

Foundation.

Bootstrap. 2.1 Resources.

Metro UI.

jQuery Mobile.

Sencha Touch.

Ionic.

HTML KickStart.

Semantic UI

Explanation:

5 0
3 years ago
Banks and other financial service companies offer many types of accounts for client's to invest their fund-- every one of them h
monitta

Answer:

//Abstract class declaration of Account

public abstract class Account{

   

   //nextId initialized to 10001

   private static int nextId = 10001;

   private int id;

   private String name;

   // constructor with one argument

   public Account(String passName){

       name = passName;

       //assign the value of nextId to id

       id = nextId;

       //nextId is incremented

       nextId++;

   }

   // accessor method to return id

   public int getId(){

       return id;

   }

   // accessor method to return name

   public String getName(){

       return name;

   }

   //abstract method that return object of type Cash

   //It is not implemented here.

   //It will be overriden and implemented by concrete subclassed

   public abstract Cash getValue();

}

Explanation:

The abstract class Account is defined with the keyword abstract. Then inside the class, we declared and initialized an integer static variable nextId, an instance variable id and a String instance variable name.

A constructor is then defined which accept one argument of a string passName.

Two accessor methods getId and getName are declared. getId return an integer id, while getName return a string name.

Finally, an abstract method getValue is declared with no implementation and it return an object of type Cash.

6 0
4 years ago
When using straight ladder ,the base of the ladder should be___away from the wall
dusya [7]
It should be angled away from the wall like |\
3 0
3 years ago
Which feature of a typical professional networking site helps users add professional details to their profile ?
ludmilkaskok [199]
All I  could find are networking cites allow people to take pics of themselves for a personal effect! hope this is what your looking for.
7 0
3 years ago
Read 2 more answers
Other questions:
  • What is the name of the subsystem that transfers data between components inside a pc or between pcs?
    12·1 answer
  • Henry wants to build a computer that will allow him to run a hypervisor program.
    9·1 answer
  • How to attach a picture on brainily?
    8·1 answer
  • A series of four or five comparisons and calculations that together determine an employee's withholding tax value might be group
    6·1 answer
  • What does a capitalist economy allow people to do?
    11·2 answers
  • A new company has proposed a number of different cache layouts for their system and you’ve
    10·1 answer
  • a pair of shoes is on sale for 15% off with this discount customers will pay $9 if they buy the shoes ​
    14·1 answer
  • Can anyone please help?
    13·1 answer
  • How to get an object from a container in java.
    11·1 answer
  • Jade has to create a workbook for storing information of students participating in the annual state-level sports competition. Th
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!