I'm trying to count how many non-empty lines are there and my code is working but I failed to count if there is the same name in different lines, for example
john 01/2
jack 01/2
john 02/3
because I want to count lines with repeated names (and different dates) as one
def number_people(path):
x = 0
with open(path) as f:
for line in f:
if line.strip():
x += 1
return x