fieldnames = ['first_name', 'last_name', 'address']
with open('names.csv') as csvfile:
reader = csv.DictReader(csvfile, fieldnames=fieldnames)
for row in reader:
print(row['first_name'], "'s number", row['last_name'], "address", row['adres'])
This is my code to print my CSV file. If the CSV file is empty, I want to print that it's empty. I thought that if i can get the row count of the file, I can check if it's empty.