paint-brush
Removing Single Line Comments: Python for Beginnersby@h3avren
1,923 reads
1,923 reads

Removing Single Line Comments: Python for Beginners

by Ajay Singh Rana5mMarch 7th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

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.
featured image - Removing Single Line Comments: Python for Beginners
Ajay Singh Rana HackerNoon profile picture
Ajay Singh Rana

Ajay Singh Rana

@h3avren

Dreaming with Python... Under a sky in India...

About @h3avren
LEARN MORE ABOUT @H3AVREN'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Ajay Singh Rana HackerNoon profile picture
Ajay Singh Rana@h3avren
Dreaming with Python... Under a sky in India...

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite