Removing Single Line Comments: Python for Beginners
Too Long; Didn't Read
I was working on a college project which was similar to markup and wanted to add comment support to it. After failing multiple times I set two basic rules for myself: If the first character of the line is ‘#’ remove the whole line. If the number of apostrophes or quotes before the “#” symbol are even then remove everything from the ” symbol to the end of the lines.