I'm trying to make a simple app to get the score of anyone on a test from the following formula:
score=(grade-average)/variance for example if your score out of 20 is 18 and the average of the class is 15 then this formula helps you to understand how is your grade in comparison to others. my code opens an excel file located in my pc in reads the points column writes them to a list then gets the average and variance and uses the formula. this is my excel file. BTW the grades in the excel are just for testing. I've tried these to codes(I'm not that pro in using classes and I was trying to make some use of it): this is the first one
class taraz:
def __init__(self,file_name,file_dir,your_point):
self.file_name=file_name
self.file_dir=file_dir
self.your_point=your_point
def sum_ave():
f=pandas.read_excel(r (file_dir))
point_list=f['point'].tolist()
sum1=sum(point_list)
ave1=sum1/len(point_list)
def variance():
for i in point_list:
var1=sqrt(((i-ave1)**2)/len(point_list))
def taraz1():
taraz1=(your_point-ave1)/var1
print(taraz1)
print(taraz1)
this is the second one:
def taraz(file_name,file_dir,your_point):
def sum_ave():
f=pandas.read_excel(r (file_dir))
point_list=f['point'].tolist()
sum1=sum(point_list)
ave1=sum1/len(point_list)
def variance():
for i in point_list:
var1=sqrt(((i-ave1)**2)/len(point_list))
def taraz1():
taraz1=(your_point-ave1)/var1
print(taraz1)
from the first code I just got and output like this: <main.taraz object at 0x02528130> and from the second one I don't get an output at all. will be glad to use your tips thanks anywas.