LearnPy Hub
← Regular Expressions problems
Easy

Split on Commas and Spaces

Read a line where items are separated by a comma and any number of spaces. Split it with re.split(r',\s*', text) and print the items one per line.

Input

One line.

Output

One item per line.

Sample 1

Input
tea, coffee,milk
Output
tea
coffee
milk

Sample 2

Input
a,b,c
Output
a
b
c
solution.py
Output appears here
Split on Commas and Spaces · Python practice problem · LearnPy Hub