Reputation: 1
I wrote a simple program where need get number and do some math problem such as the perimeter and area of a triangle.
It shows an error:
Traceback (most recent call last):
File "D:\\AAA\\Custom.py", line 154, in \<module\>
command=Matem()
File "D:\\AAA\\Custom.py", line 8, in Matem
a=int(a1)
ValueError: invalid literal for int() with base 10: ''
Her is my code, I think I wrote all correct but I do not understand why it does not work:
def Matem():
a1 = (exaA_lbl.get())
b1 = (exaB_lbl.get())
c1 = (exaC_lbl.get())
a=int(a1)
b=int(b1)
c=int(c1)
P = a+b+c
S = math.sqrt(P\*(P-a)*(P-b)*(P-c))
exaP_lbl.insert(0,P)
exaS_lbl.insert(0,S)
if(a==b==c):
exaINFO_lbl.insert(0,'a==b==c')
elif(a!=b==c):
exaINFO_lbl.insert(0, 'a!=b==c')
elif(a==b!=c):
exaINFO_lbl.insert(0, 'a==b!=c')
elif(a!=b!=c):
exaINFO_lbl.insert(0, 'a!=b!=c')
else:
exaINFO_lbl.insert(0, 'a!=c==b')
Upvotes: 0
Views: 24