The below snippets were taken from the website for xlswriter. I don't understand what the
first snippet is doing (the part that starts with expenses = (. Is that a function? I'm completely new to Python (as is probably obvious lol).
first snippet is doing (the part that starts with expenses = (. Is that a function? I'm completely new to Python (as is probably obvious lol).
# Some data we want to write to the worksheet.
expenses = (
['Rent', 1000],
['Gas', 100],
['Food', 300],
['Gym', 50],
)
# Start from the first cell. Rows and columns are zero indexed.
row = 0
col = 0
# Iterate over the data and write it out row by row.
for item, cost in (expenses):
worksheet.write(row, col, item)
worksheet.write(row, col + 1, cost)
row += 1
