Skip to content

Instantly share code, notes, and snippets.

@claudioacioli
Created January 14, 2021 01:06
Show Gist options
  • Save claudioacioli/5c579a01b8a848aca1bce2504f90fb3b to your computer and use it in GitHub Desktop.
Save claudioacioli/5c579a01b8a848aca1bce2504f90fb3b to your computer and use it in GitHub Desktop.
Python
# with is the better approuch to open and close files
with open('dogs.txt') as reader:
for line in reader:
print(line, end='') #end parameter change the last character of the line
# iterate for reader, line by line is more effecitily
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment