#! /usr/bin/env python3

def remove_comments(text):
    lines = text.split('\n')
    print('lines = ', lines)
    filtered = [ l for l in lines if l[0:1] != '#' ]
    print('filtered = ', filtered)
    r = '\n'.join(filtered)
    return r

t = remove_comments('''
a
# comment
b
c
''')

print(t)
