Python: Sum of two lowest negative numbers of a given array of integers
Sum Two Lowest Negatives
Write a Python program to calculate the sum of two lowest negative numbers in a given array of integers.
An integer (from the Latin integer meaning "whole") is colloquially defined as a number that can be written without a fractional component. For example, 21, 4, 0, and −2048 are integers.
Sample Solution-1:
Python Code:
Sample Output:
Original list elements: [-14, 15, -10, -11, -12, -13, 16, 17, 18, 19, 20] Sum of two lowest negative numbers of the said array of integers: -27 Original list elements: [-4, 5, -2, 0, 3, -1, 4, 9] Sum of two lowest negative numbers of the said array of integers: -6
Flowchart:

Sample Solution-2:
Python Code:
Sample Output:
Original list elements: [-14, 15, -10, -11, -12, -13, 16, 17, 18, 19, 20] Sum of two lowest negative numbers of the said array of integers: -27 Original list elements: [-4, 5, -2, 0, 3, -1, 4, 9] Sum of two lowest negative numbers of the said array of integers: -6
Flowchart:

For more Practice: Solve these Related Problems:
- Write a Python program to sum the two highest negative numbers in a given list.
- Write a Python program to sum the two lowest negative numbers and then compute their absolute difference.
- Write a Python program to multiply the two smallest negative numbers together and output the product.
- Write a Python program to identify the two negative numbers with the smallest absolute values and return their sum.
Go to:
Previous: Write a Python program to remove all the values except integer values from a given array of mixed values.
Next: Write a Python program to sort a given positive number in descending/ascending order.
Python Code Editor:
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.