Когда я делал это с помощью онлайн-учебника, он постоянно говорил мне, что с цитатами произошла ошибка, но после редактирования я все еще не вижу проблемы. Можете ли вы помочь?
import csv
with open("CSV_birthdays.txt") as csv_file:
csv_converter = csv.reader(csv_file, delimiter=',') # This suggests that commas seperate classes
linenum = 0
for row in csv_converter:
if linenum == 0:
print("There are 4 family members I have dealt with so far")
linenum +=1 # go to the next line
else: # for the actual columns printing out my sentences
print(f"\t{row[0]} is {row[1]} years old, and they were born on the {row[2]}th) of {row[3]}{row[4]}.")
linenum += 1 # print the next line
print(f"I have the birthdays of {linenum} people")
Это CSV-файл, который я имею в виду
name, age, birthday ,birthday month, birth year
me, 15, 17, March, 2005
my sister, 13 , 1 , 8, 3006
Manson, 10, 22, 11, 2009
Fred, 15, 7, 6, 2004