import res = ' 5, 3, , hello'print(re.split('[\s,]+', s.strip()))
Standard input is empty
['5', '3', 'hello']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!