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
1 Resposta
+ 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/