Question
Make a python program in which you have a list containing a mixture of positive and negative doubles (decimal numbers). Find the sum of the
Make a python program in which you have a list containing a mixture of positive and negative doubles (decimal numbers). Find the sum of the positive numbers in the list as well as the sum of the negative numbers in the list using python. Make sure to print out both of the sums at the end. Your list must have 10 numbers and must contain both positive numbers and negative numbers. In order to do this, you must use a loop and conditional statements.
For example: mylist = [-1.3, 5.6, 3.9, 4.7, -1.8, -6.0, 2.3, -12.8, 17.4, -5.7, 7.1, 3.2]
Must be in IDE. Can't put values on the console.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started