i wanna make calculator im done with making =(eqal ) but i dont know how to make sin ,cos,✓(root)by using def help me ..please | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

i wanna make calculator im done with making =(eqal ) but i dont know how to make sin ,cos,✓(root)by using def help me ..please

from tkinter import * import math window= Tk() window.title("My calculator") display=Entry(window,width=33,bg="yellow") display.grid(row=0,column=0,columnspan=5) button_list=[ '7','8','9','/','c', '4','5','6','*','sin', '1','2','3','-','cos', '0','.','=','+','√'] def click(key): if key=="=": result=eval(display.get()) s=str(result) display.insert(END,"="+s) else: display.insert(END,key) row_index=1 col_index=0 for button_text in button_list: def process(t=but

6th Jun 2021, 8:17 AM
김인규
1 Answer
+ 1
Hi 김인규 For a square root import the math library in pythom and call math.sqrt( int, float, ect) For trigonomitry: math.cos(value) math.sin() math.tan() Check out GeeksforGeeks for more details on the math library… https://www.google.com.au/amp/s/www.geeksforgeeks.org/JUMP_LINK__&&__python__&&__JUMP_LINK-math-cos-function/amp/
6th Jun 2021, 8:48 AM
Ollie Q
Ollie Q - avatar