Why do I get "can’t multiply sequence by non-int of type ‘float’" error?

level: beginner

Why do I get "can't multiply sequence by non-int of type 'float'" error?

import openpyxl as xl
wb = xl.load_workbook('transaction.xlsx')
sheet = wb['Sheet1']


for row in range(2, sheet.max_row + 1):
    cell = sheet.cell(row, 3)
    new_price = cell.value * 0.9
    new_price_cell = sheet.cell(row, 4)
    new_price_cell.value = new_price

wb.save('transaction1.xlsx')

I am importing transaction.xlsx file.



Read more here: https://stackoverflow.com/questions/64420150/why-do-i-get-cant-multiply-sequence-by-non-int-of-type-float-error

Content Attribution

This content was originally published by Neel Shah at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: