Using the calculator program that you designed previously, add the functionality for the following buttons: C will clear the label. will add sqrt( to the label. x^y will add ^ to the label. % will add % to the label. LOG will add log( to the label. Will add value 3.14159... to the label. = will evaluate the expression. User will be notified of any syntax or division by 0 error. Note: For square root symbol, copy √ and paste it in the text of the button. For Π symbol, use text=u"\u220f" in the definition of the button.   The code I want to add the functions in: from tkinter import * window=Tk() window.title("Calculator") lbl1=Label(text="",width=15,bg="#40E0D0") lbl1.place(x=0,y=10) window.resizable(False,False) btn1=Button(text=" C ") btn1.place(x=0,y=40) btn2=Button(text=" √ ") btn2.place(x=35,y=40) btn3=Button(text="x^y") btn3.place(x=72,y=40) btn4=Button(text=" % ") btn4.place(x=115,y=40) btn5=Button(text=" 1 ") btn5.place(x=0,y=85) btn6=Button(text=" 2 ") btn6.place(x=35,y=85) btn7=Button(text=" 3 ") btn7.place(x=72,y=85) btn8=Button(text=" + ") btn8.place(x=115,y=85) btn9=Button(text=" 4 ") btn9.place(x=0,y=130) btn10=Button(text=" 5 ") btn10.place(x=35,y=130) btn11=Button(text=" 6 ") btn11.place(x=72,y=130) btn12=Button(text=" - ") btn12.place(x=115,y=130) btn13=Button(text=" 7 ") btn13.place(x=0,y=175) btn14=Button(text=" 8 ") btn14.place(x=35,y=175) btn15=Button(text=" 9 ") btn15.place(x=72,y=175) btn16=Button(text=" * ") btn16.place(x=115,y=175) btn17=Button(text=" 0 ") btn17.place(x=0,y=220) btn18=Button(text=" . ") btn18.place(x=35,y=220) btn19=Button(text="LOG") btn19.place(x=72,y=220) btn20=Button(text=" / ") btn20.place(x=121,y=220) btn21=Button(text=" ( ") btn21.place(x=0,y=265) btn22=Button(text=" ) ") btn22.place(x=35,y=265) btn23=Button(text=u" \u220f ") btn23.place(x=72,y=265) btn24=Button(text=" = ") btn24.place(x=117,y=265) window.geometry("155x310") window.mainloop()

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter6: Creating, Sorting, And Querying A Table
Section: Chapter Questions
Problem 10EYK
icon
Related questions
Question

Using the calculator program that you designed previously, add the functionality for the following buttons:
C will clear the label.
will add sqrt( to the label.
x^y will add ^ to the label.
% will add % to the label.
LOG will add log( to the label.
Will add value 3.14159... to the label.
= will evaluate the expression. User will be notified of any syntax or division by 0 error.

Note: For square root symbol, copy √ and paste it in the text of the button.
For Π symbol, use text=u"\u220f" in the definition of the button.

 

The code I want to add the functions in:

from tkinter import *

window=Tk()
window.title("Calculator")
lbl1=Label(text="",width=15,bg="#40E0D0")
lbl1.place(x=0,y=10)
window.resizable(False,False)

btn1=Button(text=" C ")
btn1.place(x=0,y=40)

btn2=Button(text=" √ ")
btn2.place(x=35,y=40)

btn3=Button(text="x^y")
btn3.place(x=72,y=40)

btn4=Button(text=" % ")
btn4.place(x=115,y=40)

btn5=Button(text=" 1 ")
btn5.place(x=0,y=85)

btn6=Button(text=" 2 ")
btn6.place(x=35,y=85)

btn7=Button(text=" 3 ")
btn7.place(x=72,y=85)

btn8=Button(text=" + ")
btn8.place(x=115,y=85)

btn9=Button(text=" 4 ")
btn9.place(x=0,y=130)

btn10=Button(text=" 5 ")
btn10.place(x=35,y=130)

btn11=Button(text=" 6 ")
btn11.place(x=72,y=130)

btn12=Button(text=" - ")
btn12.place(x=115,y=130)

btn13=Button(text=" 7 ")
btn13.place(x=0,y=175)

btn14=Button(text=" 8 ")
btn14.place(x=35,y=175)

btn15=Button(text=" 9 ")
btn15.place(x=72,y=175)

btn16=Button(text=" * ")
btn16.place(x=115,y=175)

btn17=Button(text=" 0 ")
btn17.place(x=0,y=220)

btn18=Button(text=" . ")
btn18.place(x=35,y=220)

btn19=Button(text="LOG")
btn19.place(x=72,y=220)

btn20=Button(text=" / ")
btn20.place(x=121,y=220)

btn21=Button(text=" ( ")
btn21.place(x=0,y=265)

btn22=Button(text=" ) ")
btn22.place(x=35,y=265)

btn23=Button(text=u" \u220f ")
btn23.place(x=72,y=265)

btn24=Button(text=" = ")
btn24.place(x=117,y=265)

window.geometry("155x310")
window.mainloop()

7"log(5)
v x^y %
1
2
4 5
6
7 8
9
LOG /
(
=
II
3.
Transcribed Image Text:7"log(5) v x^y % 1 2 4 5 6 7 8 9 LOG / ( = II 3.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
ListBox
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning