You are given n successive discounts in percentages. Your task is to find the equivalent discount in percentage. Input will contain a list in which each element of the list will be discount in percentage that will be negative in sign.

**Examples:**

Input :a = [-10, -35, -60, -75]Output :-94.14Input :a = [-5, -20, -10.-23]Output :-49.08

SUCCESSIVE CHANGES = A + B + (A*B) / 100

**How does this formula work?**

Let x be the initial value. After A% change, value of x becomes (x + x*A/100). After successive B% change, value of x becomes (x + x*A/100) + (x + x*A/100)*B/100. So increment in x’s value is x*(A + B + A*B/100)/100. In terms of percentage, we can say that the value is incremented by (A + B + A*B/100)%

**Approach:**

- Simply, apply sucessive change formula between arr[0] and arr[1] and store the result in result variable.
- Now, calculate successive change between result and arr[2] using the above formula and store the result in result variable and so on.

**Code: Python program for finding the equivalent discount in successive discounts in percentages.**

`# Function to find the equivalent discount in ` `# successive discounts in percentages ` `def` `equivalentdis(a): ` ` ` `if` `(` `len` `(a)` `=` `=` `1` `): ` ` ` `return` `(a[` `0` `]) ` ` ` `else` `: ` ` ` `# succesive change from two = a[0] + a[1]+ (a[0]*a[1])/100 ` ` ` `change ` `=` `(a[` `0` `] ` `+` `a[` `1` `]` `+` `(a[` `0` `]` `*` `a[` `1` `])` `/` `100` `) ` ` ` `for` `i ` `in` `range` `(` `2` `, ` `len` `(a)): ` ` ` `# iterating a[0] + a[1]+ (a[0]*a[1])/100 ` ` ` `# len(a)-2 times ` ` ` `change ` `=` `(change ` `+` `a[i]` `+` `(change ` `*` `a[i]) ` `/` `100` `) ` ` ` `return` `change; ` `# Driver code ` `print` `(equivalentdis([` `-` `10` `, ` `-` `20` `, ` `-` `30` `, ` `-` `40` `])) ` ` ` |

*chevron_right*

*filter_none*

**Output :**

-69.75999999999999

Attention geek! Strengthen your foundations with the **Python Programming Foundation** Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the **Python DS** Course.

## Recommended Posts:

- Python | Generate successive element difference list
- Python - Successive element pairing
- Python - Successive Characters Frequency
- Python - Extract Strings with Successive Alphabets in Alphabetical Order
- Python - Extract Percentages from String
- Python - Check if two strings are Rotationally Equivalent
- Analysis of Different Methods to find Prime Number in Python
- Python program to find IP Address
- Find average of a list in python
- Find all the patterns of “1(0+)1” in a given string using Python Regex
- Find the k most frequent words from data set in Python
- Python program to find N largest elements from a list
- Python | Find the Number Occurring Odd Number of Times using Lambda expression and reduce function
- Python List Comprehension to find pair with given sum from two arrays
- Python Set difference to find lost element from a duplicated array
- Python map function to find row with maximum number of 1's
- Python heapq to find K'th smallest element in a 2D array
- Python Dictionary to find mirror characters in a string
- Python Counter to find the size of largest subset of anagram words
- Python Counter| Find duplicate rows in a binary matrix

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.