Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2022
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. def openfile():
  2.     with open(f'{input()}', 'r') as file:
  3.         lines = file.read().splitlines()
  4.     return lines
  5.  
  6.  
  7. def checkcode(lines):
  8.     for idx, line in enumerate(lines):
  9.         if len(line) > 79:
  10.             print(f"Line {idx + 1}: S001 Too long")
  11.  
  12.  
  13. checkcode(openfile())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement