kept getting
ValueError: too many values to unpack(expected 2)
here's the csv file:
adebayo,sagamu sagamu, olomu
yusuf,sagamu sagamu
kayode,sagamu sagamu
gbolahan,ilorin ilorin
abiodun,ilorin ilorin
import csv
students = []
with open("names.csv") as file:
reader = csv.reader(file)
for name, home in reader:
students.append({"name": name, "home": home})
for student in sorted(students, key=lambda student: student["name"]):
print(f"{student['name']} is from {student['home']}")