s = "Line 1\n2 Line 2\n3Line 3\nLine 4"for line in s.split("\n"): if line and line[0].isdigit(): print(line)
Standard input is empty
2 Line 2 3Line 3
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!