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]
2 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]2 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
Question 1
blondinia [14]

Answer:

888 + 88 + 8 + 8 + 8 = 1000

Explanation:

Required

Add up to 1000 using only digit 8

There is no straight way to answer this question; so, we make use of trial by error method to arrive at our solution.

After several trials, I found out that:

888 + 88 + 8 + 8 + 8 = 1000

6 0
2 years ago
A computer is a multipurpose device that accepts input processes data and produces output all according to a series of stored
yulyashka [42]
According to a series of stored procedures 
8 0
2 years ago
Which are advantages of using a server operating system?
iogann1982 [59]

Answer:

Extra security features and networking services built right in

Explanation:

The major advantage of using a server operating system is that it has decent security features and networking services built right in it from the default settings

8 0
2 years ago
Please help me very important
3241004551 [841]

Answer:

C, Or D.

Explanation:

<em>Because A speed enhancing hard drive Can store any type of quick file if you just click on it will load fast. Same thing goes for a hard drive but you have to transfer the file</em>

4 0
2 years ago
Most _____ focus on galning entry over the internet to a secure computer system by finding a
dangina [55]

Most <u>Malware</u>  focus on gaining entry over the internet to a secure computer system by finding a  working user ID and password combination.

<u>Explanation:</u>

A malware is a small computer program which works on the user’s system without knowing to the user. Different malware works differently.

Some malware sits on the user computer, create multiple unnecessary files and make the hard drive full, some people create viruses to show their computer skills which they tend to prove in a wrong way, some malware sits in the computer to steal data especially while using internet.

So there are malware's like Virus, Worm, Trojan, spyware, etc.

5 0
3 years ago
Other questions:
  • Learning about public speaking can help improve your ________________.
    15·1 answer
  • What is the advantage of defining a target user?
    6·1 answer
  • Develop a Matlab program that allows you to plot the entropy of a source with variable output probabilities. We wish to observe
    8·1 answer
  • Your program is going to compare the distinct salaries of two individuals for the last 5 years. If the salary for the two indivi
    15·1 answer
  • What is aperture priority mode? When might you use this mode on a camera? What is depth of field? How can you adjust the depth o
    13·1 answer
  • What is a single-user computer?
    8·1 answer
  • In a _error,solution is working but not giving required results
    14·1 answer
  • How to deactivate the brainly account?​
    13·1 answer
  • What are your thoughts on copyright?<br><br> (Write 2 or more sentences)
    9·2 answers
  • What is the answer ????​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!