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
Approximately how long did it take, in minutes, for the body to return to normal after the intake of water.
labwork [276]

Answer:

30

Explanation:

it takes 30 minutes to digest

5 0
2 years ago
Does a 21.6v battery work with a 24 volt controller
Mila [183]
Yes but you will need more than one battery
3 0
3 years ago
Dione has created a PowerPoint presentation that has several common nouns, names of products, etc. He is
svetlana [45]

Answer:

D. Add

Explanation:

PowerPoint application can be defined as a software application or program designed and developed by Microsoft, to avail users the ability to create various slides containing textual and multimedia informations that can be used during a presentation. Some of the features available on Microsoft PowerPoint are narrations, transition effects, custom slideshows, animation effects, formatting options etc.

In this scenario, Dione has created a PowerPoint presentation that has several common nouns, names of products, etc. He is running Spell Checker and does not want to be notified in regard to these words in this presentation or in any other presentation created on this computer. Hence, the option he should choose is Add. This would be used to automatically add a list of all the common nouns.

3 0
2 years ago
Read 2 more answers
Which of the following is a way the operating system prevents unknown or unauthorized users from accessing the system?
Xelga [282]

Put a code or security system on or a very secure password

Hope this helps...

6 0
3 years ago
Read 2 more answers
_____ is a higher-level, object-oriented application interface used to access remote database servers
makkiz [27]
RDO.

RDO uses the lower-level DAO and ODBC for direct access to databases.
7 0
1 year ago
Other questions:
  • The groups_per_user function receives a dictionary, which contains group names with the list of users. Users can belong to multi
    11·1 answer
  • What of the following google tools support collaboration
    10·1 answer
  • Your friend is working on fixing their Homework assignment. They need a lot of help. You know all the bugs in the file, but due
    12·1 answer
  • A coworker asks your opinion about how to minimize ActiveX attacks while she browses the Internet using Internet Explorer. The c
    14·1 answer
  • Which is a description of phishing?
    7·1 answer
  • Insurance can help you:
    12·1 answer
  • Initialized the variable with the value 0
    11·2 answers
  • I ONLY HAVE 5 MIN HELPPPPPP
    15·2 answers
  • What maintains data about various types of objects, events, people, and places?
    10·1 answer
  • Looking for similarities between concepts or problems is referred to as
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!