Hello, This is my first attempt at writing a program using Python and I'm a bit stuck.
I'd like to write the sequence shown in the comments to an Excel spreadsheet. I can do it for just one variable i but get an error (Value Error: Too many values to unpack (Expected 2) when i try to use a second variable j to create a nested loop.
Can anyone help? (Sorry I know this will seem really basic to some)
Here is the code:
I'd like to write the sequence shown in the comments to an Excel spreadsheet. I can do it for just one variable i but get an error (Value Error: Too many values to unpack (Expected 2) when i try to use a second variable j to create a nested loop.
Can anyone help? (Sorry I know this will seem really basic to some)
Here is the code:
import xlsxwriter workbook = xlsxwriter.Workbook('MyTest.xlsx') worksheet = workbook.add_worksheet() row = 0 col = 0 for i,j in range(0,2),(0,2): worksheet.write(row, col, i) worksheet.write(row, col+1, j) row += 1 workbook.close()#want output
Output:#00
#01
#02
#10
#11
#12
#20
#21
#22