file = open("accounts.txt", "r")
num = len(file.readlines())
file = open("accounts.txt", "r")
this is my current solution but it just feels wrong, is there a better way of finding num without reopening the file to reset the cursor?
file = open("accounts.txt", "r")
num = len(file.readlines())
file = open("accounts.txt", "r")
this is my current solution but it just feels wrong, is there a better way of finding num without reopening the file to reset the cursor?