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
Grace [21]
3 years ago
13

Write a Python function that takes as input a list, A, and returns two lists L and G. L constains all numbers in A, which are no

t A[0] and are less than or equal to A[0]. G contains all numbers in A, which are not A[0], and are greater than A[0].
Computers and Technology
1 answer:
DiKsa [7]3 years ago
8 0

Answer:

In Python:

def split(A):

   L=[]; G=[]

   for i in range(1,len(A)):

       if (A[i] != A[0] and A[i] < A[0]):

           L.append(A[i])

       if (A[i] != A[0] and A[i] > A[0]):

           G.append(A[i])

   return L, G

Explanation:

This defines the function

def split(A):

This initializes the L and G lists

   L=[]; G=[]

This iterates through the original list A

   for i in range(1,len(A)):

This populates list L using the stated condition

<em>        if (A[i] != A[0] and A[i] < A[0]):</em>

<em>            L.append(A[i])</em>

This populates list G using the stated condition

<em>        if (A[i] != A[0] and A[i] > A[0]):</em>

<em>            G.append(A[i])</em>

This returns the two lists L and G

   return L, G

You might be interested in
Someone knows a good compiler for iPad? It has to be an app
aksik [14]
Jedona is a good one
5 0
3 years ago
When should you close the socket python tcp server client.
Aleksandr-060686 [28]
F socket refers to an open TCP connection, the connection is closed. If a stream socket is closed when there is input data queued, the TCP connection is reset rather than being cleanly closed. The descriptor of the socket to be closed

To close the socket you need to call shutdown() first and then close(), and shutdown takes an argument
4 0
3 years ago
Remember to check the on your vehicle first to see if a repair is covered by the manufacturer.
krok68 [10]

Answer:

insurance or warranty

Explanation:

It should be insurance because insurance can cover things like car repairs and other things that goes wrong. warranty could work too because it kind of means the same thing.

5 0
4 years ago
Which devices are likely to include a computer? Select 3 options.
Veronika [31]

Answer:

Cell Phone, ATM Cash Machine, and a GPS Mapping Device

5 0
3 years ago
Systems management involves allocation of computer resources to keep all processes operating smoothly and at maximum efficiency.
olchik [2.2K]

Answer:operating system (OS), program that manages a computer's resources, especially the allocation of those resources among other programs. Typical resources include the central processing unit (CPU), computer memory, file storage, input/output (I/O) devices, and network connections.

Explanation:

8 0
3 years ago
Other questions:
  • Every preprocessing directive must begin with:
    11·1 answer
  • Monochrome refers to the use of one color in various shades and tints
    6·1 answer
  • Write a C or C program A6p2.c(pp) that accepts one command line argument which is an integer n between 2 and 4 inclusive. Genera
    9·1 answer
  • A network design engineer has been asked to design the IP addressing scheme for a customer network. The network will use IP addr
    6·1 answer
  • How do you take a picture on this app
    10·1 answer
  • Common types of possessed objects are smart cards, rfid-encoded badges, magnetic cards, ____, and smartphones that are swiped th
    7·1 answer
  • How to do “Pseudocode” and “FlowChart” in this question ? <br><br> Please Help mee
    9·1 answer
  • In the function below, use a function from the random module to return a random integer between the given lower_bound and upper_
    10·1 answer
  • The compound known as butylated hydroxytoluene, abbreviated as BHT, contains carbon, hydrogen, and oxygen. A 1.501 g sample of B
    11·1 answer
  • Lab 6B: printing a binary number
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!