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
To prevent rust from forming, a light coating of_____should be applied to all machined surfaces
Fantom [35]
What is that I never heard of that before
4 0
3 years ago
Which of the following is the most compelling
Gemiola [76]
To compare data makes the most sense
5 0
3 years ago
Read 2 more answers
Which of the following mountain ranges stretches from Alabama to Canada?
Vikki [24]
The Appalachian Mountains
4 0
3 years ago
What are the oop concept of java
mash [69]

Answer: OOP concepts in Java are the main ideas behind Java’s Object Oriented Programming. They are abstraction, encapsulation, inheritance, and polymorphism. Grasping them is key to understanding how Java works. Basically, Java OOP concepts let us create working methods and variables, then re-use all or part of them without compromising security.

HOPE THIS HELPED IS NOT SORRY.

4 0
2 years ago
Read 2 more answers
When connecting a trunk link between two switches, it is important to configure the allowed VLANs correctly on either end. If th
Len [333]

Answer: A VLAN mismatch

Explanation:

 The VLAN mismatch is the process when the both ends of the truck line are not connected correctly and properly between the two switches.

  • The configuration of the VLAN is done correctly as it is important to connecting the VLAN on either of the ends for avoiding the VLAN mismatch occurrence.
  • By default the truck allow the VLAN 2094 for traversing the trunk by using the native VLAN in the form of VLAN 1.

Therefore, VLAN mismatch is the correct answer.

4 0
3 years ago
Other questions:
  • What would be some long- term goals.
    11·1 answer
  • Is 37 words per minute when typing an okay grade?
    15·2 answers
  • PLEASE PLEASE PLEASE HELP!! WILL GIVE A BRAINLIEST IF UR RIGHT!!
    14·1 answer
  • Select the correct text in the passage. George is working as a lead team lead. Which statements correctly describes the skills t
    12·1 answer
  • The following code accomplishes which of the tasks written below? Assume list is an int array that stores positive int values on
    9·1 answer
  • The labels on the tab buttons on the Driver tab of the Windows Device are Driver Details, Update Driver, Roll Back Driver, Unins
    12·1 answer
  • !WILL MARK BRAINLIEST!
    8·1 answer
  • How do professionals address their problems?
    14·2 answers
  • In binary, the second digit from the right is multiplied by the first power of two, and the _____ digit from the right is multip
    10·2 answers
  • Please what do you guys think about this ?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!