72 answer = number1 + number2
73 print("The answer is: " + str(answer))
74 with open('Log.txt', 'a') as f:
75 f.writelines(str(number1) + str(operator1) + str(number2) + '=' + str(answer) + '\n') 76elif operator1 == '-':
77 answer = number1 - number2
78 print(answer)
39 print("You have to type a number!")
40 sys.exit()
41operator1 = input("Type out your operator: ")
42 #operator1 == '+' or '-' or '*' or '/' or '^' or 'sqrt' or 'log' or 'sin' or 'cos' or 'tan' or ('tan^-1') or ('cos^-1') or ('sin^-1') 43
44if operator1 in ch:
45 pass
8ch = ['+' , '-' , '*' , '/' , '^' , 'sqrt' , 'log' , 'sin' , 'cos' , 'tan' , 'tan^-1' ,'cos^-1' ,'sin^-1', '!']
9ch_trig = ['sin' , 'cos' , 'tan' , 'tan^-1' ,'cos^-1' ,'sin^-1', 'sqrt' , 'log' , '!']
10pi = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
11e = 2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664274 12
13print("Welcome to the calculator!")
14print("These are the available operations:")
7#ch_pi =['pi' , 'π']
8ch = ['+' , '-' , '*' , '/' , '^' , 'sqrt' , 'log' , 'sin' , 'cos' , 'tan' , 'tan^-1' ,'cos^-1' ,'sin^-1', '!']
9ch_trig = ['sin' , 'cos' , 'tan' , 'tan^-1' ,'cos^-1' ,'sin^-1', 'sqrt' , 'log' , '!']
10pi = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679 11e = 2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664274
12
13print("Welcome to the calculator!")
5from xml.dom.pulldom import IGNORABLE_WHITESPACE
6# lists for confirming validity of inputs
7#ch_pi =['pi' , 'π']
8ch = ['+' , '-' , '*' , '/' , '^' , 'sqrt' , 'log' , 'sin' , 'cos' , 'tan' , 'tan^-1' ,'cos^-1' ,'sin^-1', '!'] 9ch_trig = ['sin' , 'cos' , 'tan' , 'tan^-1' ,'cos^-1' ,'sin^-1', 'sqrt' , 'log' , '!']
10pi = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
11e = 2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664274
Line length greater than configured max_line_length
detected, defaults to 79 character. This limit can be configured docs