From 205c502ef01a7a38fcd5bcce35ecba2f2e4b37cd Mon Sep 17 00:00:00 2001 From: DevanshiPatel18 <61454611+DevanshiPatel18@users.noreply.github.com> Date: Wed, 28 Oct 2020 15:28:22 +0530 Subject: [PATCH 01/10] Hacktoberfest: Created greedy_coin_change.py file added the file in greedy_methods folder to implement the same method --- greedy_method/greedy_coin_change.py | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 greedy_method/greedy_coin_change.py diff --git a/greedy_method/greedy_coin_change.py b/greedy_method/greedy_coin_change.py new file mode 100644 index 000000000000..404fb254cd5c --- /dev/null +++ b/greedy_method/greedy_coin_change.py @@ -0,0 +1,48 @@ +""" +Test cases: +find_minimum_change(987) +500 100 100 100 100 50 20 10 50 2 +find_minimum_change(500) +500 +find_minimum_change(0) +The total value cannot be zero or negetive +find_minimum_change(-96) +The total value cannot be zero or negetive +find_minimum_change(56) +50 5 1 +""" + + +def find_minimum_change(V): + total_value = int(V) + # All denominations of Indian Currency + denominations = [1, 2, 5, 10, 20, 50, 100, 500, 2000] + length = len(denominations) + + # Initialize Result + answer = [] + + # Traverse through all denomination + i = length - 1 + while i >= 0: + + # Find denominations + while int(total_value) >= int(denominations[i]): + total_value -= int(denominations[i]) + answer.append(denominations[i]) # Append the "answers" array + + i -= 1 + + # Print result + for i in range(len(answer)): + print(answer[i], end=" ") + + +# Driver Code +if __name__ == "__main__": + n = input("Enter the change you want to make in Indian Currency: ").strip() + if int(n) == 0 or int(n) < 0: + print("The total value cannot be zero or negetive.") + else: + print("Following is minimal number", "of change for", n, ": ", end="") + find_minimum_change(n) From 4bdc334b5e05284b3ce23d3efe42d6f680c913c0 Mon Sep 17 00:00:00 2001 From: DevanshiPatel18 <61454611+DevanshiPatel18@users.noreply.github.com> Date: Fri, 27 Nov 2020 10:53:15 +0530 Subject: [PATCH 02/10] Add files via upload Altered the code according to the changes that were requested. --- greedy_method/greedy_coin_change.py | 97 ++++++++++++++++++++--------- 1 file changed, 68 insertions(+), 29 deletions(-) diff --git a/greedy_method/greedy_coin_change.py b/greedy_method/greedy_coin_change.py index 404fb254cd5c..36e4af716be4 100644 --- a/greedy_method/greedy_coin_change.py +++ b/greedy_method/greedy_coin_change.py @@ -1,48 +1,87 @@ """ Test cases: -find_minimum_change(987) -500 100 100 100 100 50 20 10 50 2 -find_minimum_change(500) +Do you want to enter your denominations ? (Y/N) :N +Enter the change you want to make in Indian Currency: 987 +Following is minimal change for 987 : +500 100 100 100 100 50 20 10 5 2 + +Do you want to enter your denominations ? (Y/N) :Y +Enter number of denomination:10 +1 +5 +10 +20 +50 +100 +200 +500 +1000 +2000 +Enter the change you want to make: 18745 +Following is minimal change for 18745 : +2000 2000 2000 2000 2000 2000 2000 2000 2000 500 200 20 20 5 + +Do you want to enter your denominations ? (Y/N) :N +Enter the change you want to make: 0 +The total value cannot be zero or negative. +Do you want to enter your denominations ? (Y/N) :N +Enter the change you want to make: -98 +The total value cannot be zero or negative. + +Do you want to enter your denominations ? (Y/N) :Y +Enter number of denomination:5 +1 +5 +100 500 -find_minimum_change(0) -The total value cannot be zero or negetive -find_minimum_change(-96) -The total value cannot be zero or negetive -find_minimum_change(56) -50 5 1 +1000 +Enter the change you want to make in Indian Currency: 456 +Following is minimal change for 456 : +100 100 100 100 5 5 5 5 5 5 5 5 5 5 5 1 """ -def find_minimum_change(V): - total_value = int(V) - # All denominations of Indian Currency - denominations = [1, 2, 5, 10, 20, 50, 100, 500, 2000] - length = len(denominations) +def find_minimum_change(denominations: list, value: int) -> list: + + total_value = int(value) # Initialize Result answer = [] # Traverse through all denomination - i = length - 1 - while i >= 0: + for denomination in reversed(denominations): # Find denominations - while int(total_value) >= int(denominations[i]): - total_value -= int(denominations[i]) - answer.append(denominations[i]) # Append the "answers" array - - i -= 1 + while int(total_value) >= int(denomination): + total_value -= int(denomination) + answer.append(denomination) # Append the "answers" array - # Print result - for i in range(len(answer)): - print(answer[i], end=" ") + return answer # Driver Code if __name__ == "__main__": - n = input("Enter the change you want to make in Indian Currency: ").strip() - if int(n) == 0 or int(n) < 0: - print("The total value cannot be zero or negetive.") + + denominations = list() + value = 0 + + if input("Do you want to enter your denominations ? (Y/N) :") == "Y": + n = int(input("Enter number of denomination:")) + + for i in range(0, n): + denominations.append(int(input().strip())) + value = input("Enter the change you want to make in Indian Currency: ").strip() + else: + # All denominations of Indian Currency if user does not enter + denominations = [1, 2, 5, 10, 20, 50, 100, 500, 2000] + value = input("Enter the change you want to make: ").strip() + + if int(value) == 0 or int(value) < 0: + print("The total value cannot be zero or negative.") + else: - print("Following is minimal number", "of change for", n, ": ", end="") - find_minimum_change(n) + print("Following is minimal ", "change for", value, ": ") + answer = find_minimum_change(denominations, value) + # Print result + for i in range(len(answer)): + print(answer[i], end=" ") From a5ef4f392de19797365c672a5250190671231831 Mon Sep 17 00:00:00 2001 From: DevanshiPatel18 <61454611+DevanshiPatel18@users.noreply.github.com> Date: Fri, 27 Nov 2020 12:10:27 +0530 Subject: [PATCH 03/10] Added doctests. doctests added to the function find_minimum_change. --- greedy_method/greedy_coin_change.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/greedy_method/greedy_coin_change.py b/greedy_method/greedy_coin_change.py index 36e4af716be4..38423fac31ba 100644 --- a/greedy_method/greedy_coin_change.py +++ b/greedy_method/greedy_coin_change.py @@ -35,14 +35,26 @@ 100 500 1000 -Enter the change you want to make in Indian Currency: 456 +Enter the change you want to make: 456 Following is minimal change for 456 : 100 100 100 100 5 5 5 5 5 5 5 5 5 5 5 1 """ def find_minimum_change(denominations: list, value: int) -> list: - + """ + Find the minimum change from the given denominations and value + >>> find_minimum_change([1, 5, 10, 20, 50, 100, 200, 500, 1000,2000], 18745) + [2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 500, 200, 20, 20, 5] + >>> find_minimum_change([1, 2, 5, 10, 20, 50, 100, 500, 2000], 987) + [500, 100, 100, 100, 100, 50, 20, 10, 5, 2] + >>> find_minimum_change([1, 2, 5, 10, 20, 50, 100, 500, 2000], 0) + [] + >>> find_minimum_change([1, 2, 5, 10, 20, 50, 100, 500, 2000], -98) + [] + >>> find_minimum_change([1, 5, 100, 500, 1000], 456) + [100, 100, 100, 100, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1] + """ total_value = int(value) # Initialize Result From 6a5c15a5e6179f13c2bf8b44b6300bbc0400aaba Mon Sep 17 00:00:00 2001 From: DevanshiPatel18 <61454611+DevanshiPatel18@users.noreply.github.com> Date: Wed, 3 Feb 2021 18:54:14 +0530 Subject: [PATCH 04/10] Added Greedy change file in Maths folder. --- maths/greedy_coin_change.py | 99 +++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 maths/greedy_coin_change.py diff --git a/maths/greedy_coin_change.py b/maths/greedy_coin_change.py new file mode 100644 index 000000000000..38423fac31ba --- /dev/null +++ b/maths/greedy_coin_change.py @@ -0,0 +1,99 @@ +""" +Test cases: +Do you want to enter your denominations ? (Y/N) :N +Enter the change you want to make in Indian Currency: 987 +Following is minimal change for 987 : +500 100 100 100 100 50 20 10 5 2 + +Do you want to enter your denominations ? (Y/N) :Y +Enter number of denomination:10 +1 +5 +10 +20 +50 +100 +200 +500 +1000 +2000 +Enter the change you want to make: 18745 +Following is minimal change for 18745 : +2000 2000 2000 2000 2000 2000 2000 2000 2000 500 200 20 20 5 + +Do you want to enter your denominations ? (Y/N) :N +Enter the change you want to make: 0 +The total value cannot be zero or negative. +Do you want to enter your denominations ? (Y/N) :N +Enter the change you want to make: -98 +The total value cannot be zero or negative. + +Do you want to enter your denominations ? (Y/N) :Y +Enter number of denomination:5 +1 +5 +100 +500 +1000 +Enter the change you want to make: 456 +Following is minimal change for 456 : +100 100 100 100 5 5 5 5 5 5 5 5 5 5 5 1 +""" + + +def find_minimum_change(denominations: list, value: int) -> list: + """ + Find the minimum change from the given denominations and value + >>> find_minimum_change([1, 5, 10, 20, 50, 100, 200, 500, 1000,2000], 18745) + [2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 500, 200, 20, 20, 5] + >>> find_minimum_change([1, 2, 5, 10, 20, 50, 100, 500, 2000], 987) + [500, 100, 100, 100, 100, 50, 20, 10, 5, 2] + >>> find_minimum_change([1, 2, 5, 10, 20, 50, 100, 500, 2000], 0) + [] + >>> find_minimum_change([1, 2, 5, 10, 20, 50, 100, 500, 2000], -98) + [] + >>> find_minimum_change([1, 5, 100, 500, 1000], 456) + [100, 100, 100, 100, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1] + """ + total_value = int(value) + + # Initialize Result + answer = [] + + # Traverse through all denomination + for denomination in reversed(denominations): + + # Find denominations + while int(total_value) >= int(denomination): + total_value -= int(denomination) + answer.append(denomination) # Append the "answers" array + + return answer + + +# Driver Code +if __name__ == "__main__": + + denominations = list() + value = 0 + + if input("Do you want to enter your denominations ? (Y/N) :") == "Y": + n = int(input("Enter number of denomination:")) + + for i in range(0, n): + denominations.append(int(input().strip())) + value = input("Enter the change you want to make in Indian Currency: ").strip() + else: + # All denominations of Indian Currency if user does not enter + denominations = [1, 2, 5, 10, 20, 50, 100, 500, 2000] + value = input("Enter the change you want to make: ").strip() + + if int(value) == 0 or int(value) < 0: + print("The total value cannot be zero or negative.") + + else: + print("Following is minimal ", "change for", value, ": ") + answer = find_minimum_change(denominations, value) + # Print result + for i in range(len(answer)): + print(answer[i], end=" ") From 504a53609dc4735ac902463637451f15ea9636cf Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Wed, 3 Feb 2021 13:28:22 +0000 Subject: [PATCH 05/10] updating DIRECTORY.md --- DIRECTORY.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/DIRECTORY.md b/DIRECTORY.md index d487b39490ed..5e40735dcc55 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -30,6 +30,7 @@ * [Binary Count Trailing Zeros](https://github.com/TheAlgorithms/Python/blob/master/bit_manipulation/binary_count_trailing_zeros.py) * [Binary Or Operator](https://github.com/TheAlgorithms/Python/blob/master/bit_manipulation/binary_or_operator.py) * [Binary Xor Operator](https://github.com/TheAlgorithms/Python/blob/master/bit_manipulation/binary_xor_operator.py) + * [Reverse Bits](https://github.com/TheAlgorithms/Python/blob/master/bit_manipulation/reverse_bits.py) * [Single Bit Manipulation Operations](https://github.com/TheAlgorithms/Python/blob/master/bit_manipulation/single_bit_manipulation_operations.py) ## Blockchain @@ -122,6 +123,7 @@ * [Fenwick Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/fenwick_tree.py) * [Lazy Segment Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/lazy_segment_tree.py) * [Lowest Common Ancestor](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/lowest_common_ancestor.py) + * [Merge Two Binary Trees](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/merge_two_binary_trees.py) * [Non Recursive Segment Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/non_recursive_segment_tree.py) * [Number Of Possible Binary Trees](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/number_of_possible_binary_trees.py) * [Red Black Tree](https://github.com/TheAlgorithms/Python/blob/master/data_structures/binary_tree/red_black_tree.py) @@ -327,6 +329,9 @@ * [Test Min Spanning Tree Kruskal](https://github.com/TheAlgorithms/Python/blob/master/graphs/tests/test_min_spanning_tree_kruskal.py) * [Test Min Spanning Tree Prim](https://github.com/TheAlgorithms/Python/blob/master/graphs/tests/test_min_spanning_tree_prim.py) +## Greedy Method + * [Greedy Coin Change](https://github.com/TheAlgorithms/Python/blob/master/greedy_method/greedy_coin_change.py) + ## Hashes * [Adler32](https://github.com/TheAlgorithms/Python/blob/master/hashes/adler32.py) * [Chaos Machine](https://github.com/TheAlgorithms/Python/blob/master/hashes/chaos_machine.py) @@ -425,6 +430,7 @@ * [Gamma](https://github.com/TheAlgorithms/Python/blob/master/maths/gamma.py) * [Gaussian](https://github.com/TheAlgorithms/Python/blob/master/maths/gaussian.py) * [Greatest Common Divisor](https://github.com/TheAlgorithms/Python/blob/master/maths/greatest_common_divisor.py) + * [Greedy Coin Change](https://github.com/TheAlgorithms/Python/blob/master/maths/greedy_coin_change.py) * [Hardy Ramanujanalgo](https://github.com/TheAlgorithms/Python/blob/master/maths/hardy_ramanujanalgo.py) * [Is Square Free](https://github.com/TheAlgorithms/Python/blob/master/maths/is_square_free.py) * [Jaccard Similarity](https://github.com/TheAlgorithms/Python/blob/master/maths/jaccard_similarity.py) From 22423d33db4e49b2a96caef24097cd39fdd0d7f6 Mon Sep 17 00:00:00 2001 From: DevanshiPatel18 <61454611+DevanshiPatel18@users.noreply.github.com> Date: Wed, 3 Feb 2021 18:58:58 +0530 Subject: [PATCH 06/10] Deleted Greedy Method Folder --- greedy_method/greedy_coin_change.py | 99 ----------------------------- 1 file changed, 99 deletions(-) delete mode 100644 greedy_method/greedy_coin_change.py diff --git a/greedy_method/greedy_coin_change.py b/greedy_method/greedy_coin_change.py deleted file mode 100644 index 38423fac31ba..000000000000 --- a/greedy_method/greedy_coin_change.py +++ /dev/null @@ -1,99 +0,0 @@ -""" -Test cases: -Do you want to enter your denominations ? (Y/N) :N -Enter the change you want to make in Indian Currency: 987 -Following is minimal change for 987 : -500 100 100 100 100 50 20 10 5 2 - -Do you want to enter your denominations ? (Y/N) :Y -Enter number of denomination:10 -1 -5 -10 -20 -50 -100 -200 -500 -1000 -2000 -Enter the change you want to make: 18745 -Following is minimal change for 18745 : -2000 2000 2000 2000 2000 2000 2000 2000 2000 500 200 20 20 5 - -Do you want to enter your denominations ? (Y/N) :N -Enter the change you want to make: 0 -The total value cannot be zero or negative. -Do you want to enter your denominations ? (Y/N) :N -Enter the change you want to make: -98 -The total value cannot be zero or negative. - -Do you want to enter your denominations ? (Y/N) :Y -Enter number of denomination:5 -1 -5 -100 -500 -1000 -Enter the change you want to make: 456 -Following is minimal change for 456 : -100 100 100 100 5 5 5 5 5 5 5 5 5 5 5 1 -""" - - -def find_minimum_change(denominations: list, value: int) -> list: - """ - Find the minimum change from the given denominations and value - >>> find_minimum_change([1, 5, 10, 20, 50, 100, 200, 500, 1000,2000], 18745) - [2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 500, 200, 20, 20, 5] - >>> find_minimum_change([1, 2, 5, 10, 20, 50, 100, 500, 2000], 987) - [500, 100, 100, 100, 100, 50, 20, 10, 5, 2] - >>> find_minimum_change([1, 2, 5, 10, 20, 50, 100, 500, 2000], 0) - [] - >>> find_minimum_change([1, 2, 5, 10, 20, 50, 100, 500, 2000], -98) - [] - >>> find_minimum_change([1, 5, 100, 500, 1000], 456) - [100, 100, 100, 100, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1] - """ - total_value = int(value) - - # Initialize Result - answer = [] - - # Traverse through all denomination - for denomination in reversed(denominations): - - # Find denominations - while int(total_value) >= int(denomination): - total_value -= int(denomination) - answer.append(denomination) # Append the "answers" array - - return answer - - -# Driver Code -if __name__ == "__main__": - - denominations = list() - value = 0 - - if input("Do you want to enter your denominations ? (Y/N) :") == "Y": - n = int(input("Enter number of denomination:")) - - for i in range(0, n): - denominations.append(int(input().strip())) - value = input("Enter the change you want to make in Indian Currency: ").strip() - else: - # All denominations of Indian Currency if user does not enter - denominations = [1, 2, 5, 10, 20, 50, 100, 500, 2000] - value = input("Enter the change you want to make: ").strip() - - if int(value) == 0 or int(value) < 0: - print("The total value cannot be zero or negative.") - - else: - print("Following is minimal ", "change for", value, ": ") - answer = find_minimum_change(denominations, value) - # Print result - for i in range(len(answer)): - print(answer[i], end=" ") From 4fc35c8d22d249b5d424ec632ad23306c6b29abf Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Wed, 3 Feb 2021 13:29:17 +0000 Subject: [PATCH 07/10] updating DIRECTORY.md --- DIRECTORY.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index 5e40735dcc55..3f4e92fe11b3 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -329,9 +329,6 @@ * [Test Min Spanning Tree Kruskal](https://github.com/TheAlgorithms/Python/blob/master/graphs/tests/test_min_spanning_tree_kruskal.py) * [Test Min Spanning Tree Prim](https://github.com/TheAlgorithms/Python/blob/master/graphs/tests/test_min_spanning_tree_prim.py) -## Greedy Method - * [Greedy Coin Change](https://github.com/TheAlgorithms/Python/blob/master/greedy_method/greedy_coin_change.py) - ## Hashes * [Adler32](https://github.com/TheAlgorithms/Python/blob/master/hashes/adler32.py) * [Chaos Machine](https://github.com/TheAlgorithms/Python/blob/master/hashes/chaos_machine.py) From 0387ecbeb5f19bd31cc23cb9cfb49d2c77f31222 Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Sat, 20 Mar 2021 11:38:05 +0530 Subject: [PATCH 08/10] Update greedy_coin_change.py --- maths/greedy_coin_change.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/maths/greedy_coin_change.py b/maths/greedy_coin_change.py index 38423fac31ba..b9202cd87b98 100644 --- a/maths/greedy_coin_change.py +++ b/maths/greedy_coin_change.py @@ -41,7 +41,7 @@ """ -def find_minimum_change(denominations: list, value: int) -> list: +def find_minimum_change(denominations: list[int], value: int) -> list[int]: """ Find the minimum change from the given denominations and value >>> find_minimum_change([1, 5, 10, 20, 50, 100, 200, 500, 1000,2000], 18745) @@ -77,11 +77,11 @@ def find_minimum_change(denominations: list, value: int) -> list: denominations = list() value = 0 - if input("Do you want to enter your denominations ? (Y/N) :") == "Y": - n = int(input("Enter number of denomination:")) + if input("Do you want to enter your denominations ? (yY/n): ").strip().lower() == "y": + n = int(input("Enter the number of denominations you want to add: ").strip()) for i in range(0, n): - denominations.append(int(input().strip())) + denominations.append(int(input(f"Denomination {i}: ").strip())) value = input("Enter the change you want to make in Indian Currency: ").strip() else: # All denominations of Indian Currency if user does not enter @@ -92,7 +92,7 @@ def find_minimum_change(denominations: list, value: int) -> list: print("The total value cannot be zero or negative.") else: - print("Following is minimal ", "change for", value, ": ") + print(f"Following is minimal change for {value}: ") answer = find_minimum_change(denominations, value) # Print result for i in range(len(answer)): From 86b7401dfd33ea263d20a7c525011956025efd11 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Sat, 20 Mar 2021 06:09:52 +0000 Subject: [PATCH 09/10] updating DIRECTORY.md --- DIRECTORY.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index 571a42132b25..2f57a9db5769 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -267,6 +267,11 @@ * Tests * [Test Send File](https://github.com/TheAlgorithms/Python/blob/master/file_transfer/tests/test_send_file.py) +## Fractals + * [Koch Snowflake](https://github.com/TheAlgorithms/Python/blob/master/fractals/koch_snowflake.py) + * [Mandelbrot](https://github.com/TheAlgorithms/Python/blob/master/fractals/mandelbrot.py) + * [Sierpinski Triangle](https://github.com/TheAlgorithms/Python/blob/master/fractals/sierpinski_triangle.py) + ## Fuzzy Logic * [Fuzzy Operations](https://github.com/TheAlgorithms/Python/blob/master/fuzzy_logic/fuzzy_operations.py) @@ -279,8 +284,6 @@ ## Graphics * [Bezier Curve](https://github.com/TheAlgorithms/Python/blob/master/graphics/bezier_curve.py) - * [Koch Snowflake](https://github.com/TheAlgorithms/Python/blob/master/graphics/koch_snowflake.py) - * [Mandelbrot](https://github.com/TheAlgorithms/Python/blob/master/graphics/mandelbrot.py) * [Vector3 For 2D Rendering](https://github.com/TheAlgorithms/Python/blob/master/graphics/vector3_for_2d_rendering.py) ## Graphs @@ -548,7 +551,6 @@ * [Primelib](https://github.com/TheAlgorithms/Python/blob/master/other/primelib.py) * [Scoring Algorithm](https://github.com/TheAlgorithms/Python/blob/master/other/scoring_algorithm.py) * [Sdes](https://github.com/TheAlgorithms/Python/blob/master/other/sdes.py) - * [Sierpinski Triangle](https://github.com/TheAlgorithms/Python/blob/master/other/sierpinski_triangle.py) * [Tower Of Hanoi](https://github.com/TheAlgorithms/Python/blob/master/other/tower_of_hanoi.py) * [Triplet Sum](https://github.com/TheAlgorithms/Python/blob/master/other/triplet_sum.py) * [Two Pointer](https://github.com/TheAlgorithms/Python/blob/master/other/two_pointer.py) From 47ed1d3a247aef31e4e880a69a6c7650ff802a21 Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Sat, 20 Mar 2021 11:43:20 +0530 Subject: [PATCH 10/10] fix: black formatting issues --- maths/greedy_coin_change.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/maths/greedy_coin_change.py b/maths/greedy_coin_change.py index b9202cd87b98..5a7d9e8d84ae 100644 --- a/maths/greedy_coin_change.py +++ b/maths/greedy_coin_change.py @@ -77,7 +77,10 @@ def find_minimum_change(denominations: list[int], value: int) -> list[int]: denominations = list() value = 0 - if input("Do you want to enter your denominations ? (yY/n): ").strip().lower() == "y": + if ( + input("Do you want to enter your denominations ? (yY/n): ").strip().lower() + == "y" + ): n = int(input("Enter the number of denominations you want to add: ").strip()) for i in range(0, n):