Skip to content

Instantly share code, notes, and snippets.

@Aniruddha-Tapas
Created October 2, 2017 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Aniruddha-Tapas/31cb6316788c1852223dad6cb0602e39 to your computer and use it in GitHub Desktop.
Save Aniruddha-Tapas/31cb6316788c1852223dad6cb0602e39 to your computer and use it in GitHub Desktop.
# Prints the line number, the line and the characters count
# of those lines in the file
# which exceed the 80 character limit.
import sys
#infile = open ("YOUR-FILE-NAME")
infile = open ("q1.rkt")
# Prints total number of lines in the program
#print(sum(1 for line in infile))
for i,line in enumerate(infile):
if len(line) >= 81:
print (i+1 , line, len(line))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment