Can someone please tell me how to sort a CSV file alphabetically in columns when the data comes from multiple variables (e.g name and age)? I need names to be displayed in alphabetical order.
Here is my code:
with open ("Information.csv", "a", newline="",) as CSVFile:
for_use = csv.writer (CSVFile, delimiter=",")
info = [[name, age]]
for_use.writerows(info)