Relative Content

Tag Archive for stringpython-3.xcomments

How to remove ‘#’ comments from a string?

The problem:
Implement a Python function called stripComments(code) where code is a parameter that takes a string containing the Python code. The function stripComments() returns the code with all comments removed.