How to remove character from tuples in list?
Question: How to remove "(" ,")" form

    
    
    [('(10', '40)'), ('(40', '30)'), ('(20', '20)')]
    

by python?


Answer: Straightforward, use list comprehension and literal_eval.

    
    
    >>> from ast import literal_eval
    >>> tuple_list = [('(10', '40)'), ('(40', '30)'), ('(20', '20)')]
    >>> [literal_eval(','.join(i)) for i in tuple_list]
    [(10, 40), (40, 30), (20, 20)]
    

