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
You csn access various sites on the www by using hyperlinks or by
Juliette [100K]
You can access sites else by ip address.
6 0
3 years ago
which process consists of one application program following a logical access path (lap) and then a dbms following a physical acc
laiz [17]

A DBMS acts as a conduit between the database and the applications that will use it, enabling users to access, modify, and control how the data is arranged and optimized.

Data points that are connected to one another are stored and accessible in a relational database, which is a form of database. The relational model, an easy-to-understand method of representing data in tables, is the foundation of relational databases. Data items are requested from the database by application programs, which are created using a combination of the DBMS's data manipulation language and a traditional programming language. The DBMS locates and provides the data elements requested by the application programs.

Learn more about database here-

brainly.com/question/6447559

#SPJ4

5 0
1 year ago
The two major types of system software programs are utility programs and the ________. Select one: A. user interface B. supervis
Scrat [10]

Answer:

operating system

Explanation:

System software are those programs that many refer to as computer programs. The most basic function of system software is to manage the computer systems. It acts as an interface between the computer’s hardware and the end user. System software converts instructions that end users give to the computer into a machine understandable language. Examples of system software include operating systems, utility programs, device drivers, and windows systems. The operating system is responsible for the functioning of all the computer’s hardware parts. It is the software loaded into the system when the computer boots up. It manages everything, from the memory, to the CPU, and many other different tasks.

8 0
3 years ago
When widgets, or portable chunks of code, are embedded on html pages and thereby help increase the functionality of those pages,
Anna11 [10]
<span>When widgets, or portable chunks of code, are embedded on html pages and thereby help increase the functionality of those pages, consumers embrace one of the greatest virtues of social media known as Collaboration.</span>
5 0
3 years ago
Can someone help me please
Andreyy89
Your anwser will be the last one
6 0
4 years ago
Read 2 more answers
Other questions:
  • You would like to arrange the records alphabetically. You should _____.
    7·2 answers
  • Why does people that gets abused not report?
    5·1 answer
  • This type of peripheral is used to interact with, or send data to, the computer.
    12·2 answers
  • After reviewing the various types of network connections available, a client chooses a network connection that is considered to
    13·1 answer
  • Statement Widgets or gadgets are _____ programs that appear on the desktop and display little pieces of information such as a ca
    5·1 answer
  • In a Java Script language. create a two-dimension array consisting of numbers representing costs. After creating the array, prin
    11·1 answer
  • Hazel has just finished adding pictures to her holiday newsletter. She decides to crop an image. What is cropping an image?
    10·1 answer
  • Explain the look of a document which contains several different font sizes and font colors​
    13·1 answer
  • Is social media bringing people together or cause in sepretation?​
    11·2 answers
  • Why are pirated software considered a threat?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!