Solution Exercise 58: python algorithm which replace all prentheses by brackets within given text
Exercise 58 Write a Python algorithm as a function which takes a string s as input and which returns another string obtained from s by replacing the possibly existing parentheses…