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
Butoxors [25]
3 years ago
8

Write a function statement() that takes as input a list of floating-point numbers, with positive numbers representing deposits t

o and negative numbers representing withdrawals from a bank account. Your function should return a list of two floating-point numbers, the first will be the sum of the deposits, and the second (a negative number) will be the sum of the withdrawals.
Computers and Technology
1 answer:
katrin2010 [14]3 years ago
5 0

Answer:

def statement(numbers):

   deposits = []

   withdrawals = []

   for number in numbers:

       if number > 0:

           deposits.append(number)

       if number < 0:

           withdrawals.append(number)

   

   return [sum(deposits), sum(withdrawals)]

Explanation:

*The code is in Python.

Create a function called statement that takes numbers as a parameter

Inside the function, create two empty lists called deposits and withdrawals. Create a for loop that iterates through the numbers. Inside the loop, if a number is greater than 0, add it to the deposits. If a number is smaller than 0, add it to the withdrawals. When the loop is done, return the sum of the deposits and the sum of the withdrawals (use sum function to sum the numbers in the lists)

You might be interested in
What are the different methods of enhancing/decorating<br> bamboo product​
Zepler [3.9K]

Explanation:

Methods of this technique include glueing, chemical gilding, and electroplating.  Staining is used to color wood to give an illusion of texture. This may come in two varieties.

7 0
3 years ago
5. List three safety concerns when using hand<br> ertain safety<br> tools.
sveta [45]

Answer:

Inspect regularly. ...

Wear gloves. ...

Carry with care. ...

Don't pocket sharp objects. ...

Be aware of your surroundings. ...

Use the right tools.

6 0
3 years ago
1. [10 marks] We begin with some mathematics regarding uncountability. Let N = {0, 1, 2, 3, . . .} denote the set of natural num
crimeas [40]

Answer:

Please see attachment

Explanation:

Please see attachment

Download pdf
6 0
4 years ago
Every computer consists of physical components and nonphysical components. the nonphysical components of a computer that underst
IrinaVladis [17]
Physical component means Computer Hardware which you can touch and non Physical component means Software, which you can not touch. nonphysical component designed specially for physically component. like Microsoft company designed Software according the Hardware for example Microsoft windows 64 bit could not install on which 32 bit Architecture Hardware.
7 0
3 years ago
Rita wants to know the size of each image in a folder. Which view will help her find this information quickly?
vaieri [72.5K]
The correct answer would be details.

8 0
3 years ago
Other questions:
  • PHP can be run on Microsoft Windows IIS(Internet Information Server):
    5·1 answer
  • A small business utilizes a SOHO router and wishes to secure its existing wireless infrastructure. The business has fewer than t
    12·1 answer
  • While creating a digital portfolio, Harry wants to add documents that authenticate his skills, experience, and knowledge in digi
    11·1 answer
  • Who is he can anyone help me​
    14·2 answers
  • Hello everyone. New ppl on Ro.blox? I want to play sometime.
    11·1 answer
  • JAVA
    13·1 answer
  • Identify the correct answer in each item. Write your answer on the blank provided before
    13·1 answer
  • GIVING 50 POINTS!
    6·2 answers
  • Need help not sure if I’m correct
    5·1 answer
  • Which of the following factors is most likely to result in low shipping and handling costs? A higher than average hourly pay rat
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!