111 f.write('(' + str(number1) + ')' + '!' + ' '+ '=' + str(answer)+ '\n')
112elif operator1 == 'sin':
113 answer = cmath.sin(number1)
114 answerln = answer * (180/pi) #converts radians to degrees115 print(answerln) #prints answer in degrees
116 with open('Log.txt', 'a') as f:
117 f.write(str(operator1) + '(' + str(number1) + ')' '=' + str(answerln)+ '\n')
117 f.write(str(operator1) + '(' + str(number1) + ')' '=' + str(answerln)+ '\n')
118elif operator1 == 'cos':
119 answer = cmath.cos(number1)
120 answerln = answer * (180/pi) #converts radians to degrees121 print(answerln)
122 with open('Log.txt', 'a') as f:
123 f.write(str(operator1) + '(' + str(number1) + ')' '=' + str(answerln)+ '\n')
123 f.write(str(operator1) + '(' + str(number1) + ')' '=' + str(answerln)+ '\n')
124elif operator1 == 'tan':
125 answer = cmath.tan(number1)
126 answerln = answer * (180/pi) #converts radians to degrees127 print(answerln)
128 with open('Log.txt', 'a') as f:
129 f.write(str(operator1) + '(' + str(number1) + ')' '=' + str(answerln)+ '\n')
130elif operator1 == 'sin^-1':
131 number1degrees = number1 * (180/pi) #converts radians to degrees
132 answer= cmath.asin(number1degrees)
133 answerln = answer134 print(answerln)
135 with open('Log.txt', 'a') as f:
136 f.write(str(operator1) + '(' + str(number1) + ')' '=' + str(answerln)+ '\n')
137elif operator1 == 'cos^-1':
138 number1degrees = number1 * (180/pi)
139 answer = cmath.acos(number1degrees)
140 answerln = answer141 print(answerln)
142 with open('Log.txt', 'a') as f:
143 f.write(str(operator1) + '(' + str(number1) + ')' '=' + str(answerln)+ '\n')
There should be only one space after an operator.