@@ -32,7 +32,7 @@ def calc(term):
3232 purpose: This function is the actual calculator and the heart of the application
3333 """
3434
35- # This part is for reading and converting arithmic terms.
35+ # This part is for reading and converting arithmetic terms.
3636 term = term .replace (' ' , '' )
3737 term = term .replace ('^' , '**' )
3838 term = term .replace ('=' , '' )
@@ -57,18 +57,15 @@ def calc(term):
5757 # here goes to the error cases.
5858 except ZeroDivisionError :
5959
60- print ("Can't divide by 0" )
61- exit (1 ) # exit(1) for indicating an error.
60+ print ("Can't divide by 0. Please try again." )
6261
6362 except NameError :
6463
65- print ('Invalid input' )
66- exit (1 )
64+ print ('Invalid input. Please try again' )
6765
6866 except AttributeError :
6967
70- print ('Check usage method' )
71- exit (1 )
68+ print ('Please check usage method and try again.' )
7269
7370 return term
7471
@@ -86,11 +83,12 @@ def result(term):
8683def main ():
8784 """
8885 main-program
89- purpose: handles the user inputs and prints
90- some informations onto console.
86+ purpose: handles user input and prints
87+ information to the console.
9188 """
9289
93- print ("\n Scientific Calculator\n Eg: sin(rad(90)) + 50% * (sqrt(16)) + round(1.42^2) - 12mod3\n Enter quit to exit" )
90+ print ("\n Scientific Calculator\n \n For Example: sin(rad(90)) + 50% * (sqrt(16)) + round(1.42^2)" + \
91+ "- 12mod3\n \n Enter quit to exit" )
9492
9593 if sys .version_info .major >= 3 :
9694 while True :
0 commit comments