I have attached an excel sheet and with the help of python code below I'm trying to fetch those roll numbers who have either secured marks less than 40 or are having an attendance below 75 percent.
But every time I run the code I face an error message :
Traceback (most recent call last): 87.0 File "C:/Users/Shubham Mishra/PycharmProjects/Python/jacc.py", line 11, in value1 = (int)(worksheet.cell(i, 2).value) ValueError: invalid literal for int() with base 10: 'Attendance'
import xlrd
workbook=xlrd.open_workbook('log.xls')
worksheet=workbook.sheet_by_index(0)
print(worksheet.cell(1,2).value)
i=1
n=6
for i in range(n):
value1 = (int)(worksheet.cell(i, 2).value)
value2 = (worksheet.cell(i, 3).value)
if ((value1<=75) or (value2<=40)):
print(worksheet.cell(i,1))