In Python, what is the simplest way to convert a number enclosed in parentheses (string) to a negative integer (or float)?
For example, \'(4,301)\' to -4301, as commonly
The simplest way is:
my_str = "(4,301)" num = -int(my_str.translate(None,"(),"))