Created
April 16, 2021 15:25
-
-
Save vinimonteiro/92d0531e2d1158724097c24e98f704fe to your computer and use it in GitHub Desktop.
Row count large file with function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def file_reader(file_path): | |
rows = [] | |
for row in open(file_path, "r"): | |
rows.append(row) | |
return rows | |
def print_row_count(): | |
count = 0 | |
for row in file_reader("large_file"): | |
count += 1 | |
print(f"Total count is {count}") | |
print_row_count() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment