1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
natta225 [31]
3 years ago
6

Python

Computers and Technology
1 answer:
marusya05 [52]3 years ago
8 0

Answer:

from tkinter import *

expression = ""

def press(num):

global expression

expression = expression + str(num)

equation.set(expression)

def equalpress():

try:

 global expression

 total = str(eval(expression))

 equation.set(total)

 expression = ""

except:

 equation.set(" error ")

 expression = ""

def clear():

global expression

expression = ""

equation.set("")

if __name__ == "__main__":

gui = Tk()

 

equation = StringVar(gui, "")

equation.set("")

gui.geometry("270x150")

expression_field = Entry(gui, textvariable=equation)

expression_field.grid(columnspan=4, ipadx=70)

buttonl = Button(gui, text=' 1', fg='black', bg='white',command=lambda: press(1), height=1, width=7)

buttonl.grid(row=2, column=0)

button2 = Button(gui, text=' 2', fg='black', bg='white',command=lambda: press(2), height=1, width=7)

button2.grid(row=2, column=1)

button3 = Button(gui, text=' 3', fg='black', bg='white',command=lambda: press(3), height=1, width=7)

button3.grid(row=2, column=2)

button4 = Button(gui, text=' 4', fg='black', bg='white',command=lambda: press(4), height=1, width=7)

button4.grid(row=3, column=0)

button5 = Button(gui, text=' 5', fg='black', bg='white',command=lambda: press(5), height=1, width=7)

button5.grid(row=3, column=1)

button6 = Button(gui, text=' 6', fg='black', bg='white',command=lambda: press(6), height=1, width=7)

button6.grid(row=3, column=2)

button7 = Button(gui, text=' 7', fg='black', bg='white',command=lambda: press(7), height=1, width=7)

button7.grid(row=4, column=0)

button8 = Button(gui, text=' 8', fg='black', bg='white',command=lambda: press(8), height=1, width=7)

button8.grid(row=4, column=1)

button9 = Button(gui, text=' 9', fg='black', bg='white',command=lambda: press(9), height=1, width=7)

button9.grid(row=4, column=2)

button0 = Button(gui, text=' 0', fg='black', bg='white',command=lambda: press(2), height=1, width=7)

button0.grid(row=5, column=0)

Add = Button(gui, text=' +', fg='black', bg='white',command=lambda: press("+"), height=1, width=7)

Add.grid(row=2, column=3)

Sub = Button(gui, text=' -', fg='black', bg='white',command=lambda: press("-"), height=1, width=7)

Sub.grid(row=3, column=3)

Div = Button(gui, text=' /', fg='black', bg='white',command=lambda: press("/"), height=1, width=7)

Div.grid(row=5, column=3)

Mul = Button(gui, text=' *', fg='black', bg='white',command=lambda: press("*"), height=1, width=7)

Mul.grid(row=4, column=3)

Equal = Button(gui, text=' =', fg='black', bg='white',command=equalpress, height=1, width=7)

Equal.grid(row=5, column=2)

Clear = Button(gui, text=' Clear', fg='black', bg='white',command=clear, height=1, width=7)

Clear.grid(row=5, column=1)

Decimal = Button(gui, text=' .', fg='black', bg='white',command=lambda: press("."), height=1, width=7)

Decimal.grid(row=6, column=0)

gui.mainloop()

Explanation:

I fixed several other typos. Your calculator works like a charm!

You might be interested in
WILL GIVE BRAILIST IF ANSWER RIGHT
Vesna [10]

Answer:

See Photo For Matching.

4 0
3 years ago
2. Identify the diagram and define it.<br>13. What are pollen grains ?<br>4. What is an embryo?​
Virty [35]

Answer:

2. I can't help you with this question because i can't see the diagram

13.Pollen grains are microscopic bodies that have the male reproductive cell of the plant.

4. An Embryo is an organism in its early stage of development.

Explanation:

2. I can't help you with this question because i can't see the diagram

13.Pollen grains are microscopic bodies that have the male reproductive cell of the plant.

4. An Embryo is an organism in its early stage of development.

7 0
3 years ago
Which adaptation of eap utilizes eap-mschapv2 inside of an encrypted tls tunnel?
cluponka [151]

Main Answer:

<h3>which adaptation of eap utilizes eap mschapv2 inside of an encrypted tls tunnel? <u>protected (EAP)</u></h3>

sub heading:

what is meant by protected( EAP)?

Explanation:

1.The protected extensible authentication protocal also known as protected (EAP).

2.transport layer security tunnen

Refference link :

https//brainly.com

Hashtag:

#SPJ4

7 0
2 years ago
Which button is used to set up the pen color?
Mrac [35]
C. custom slideshow because this is where you can customise everything you do eg. pen colour, don't etc.
5 0
4 years ago
Read 2 more answers
Alex recently earned his security certification and has been offered a promotion to a position that requires him to analyze and
nikitadnepr [17]

Alex recently earned his security certification and has been offered a promotion to a position that requires him to analyze and design security solutions as well as identifying users’ needs.Alex been offered

A.Security administrator

Explanation:

  • A security systems administrator handles all aspects of information security and protects the virtual data resources of a company.
  • They are responsible for desktop, mobile, and network security, and are also responsible for installing, administering and troubleshooting an organization's security solutions.
  • A security administrator is the point person for a cybersecurity team.
  • A Security Administrator installs, administers, and troubleshoots an organization's security solutions.
  • The Security Administrator will ensure the network's security, protect against unauthorized access, modification, or destruction, and troubleshoot any access problems

3 0
4 years ago
Other questions:
  • A user is connecting to an e-commerce server to buy some widgets for a company. the user connects to the site and notices there
    10·1 answer
  • What is the term for a web site and network used only by employees within a company?
    12·1 answer
  • Ed has just finished typing a long financial report. Before he sends this report to shareholders, Ed should _____.
    9·2 answers
  • The use of _______________ can validate input responses from clients and prevent certain attack methodologies
    14·1 answer
  • Which item is used for formatting in responsive web design?
    14·2 answers
  • Dynamic addressing: __________.
    12·2 answers
  • Write an essay about yourself based on the dimensions of ones personality​
    9·1 answer
  • Write an algorithm to sum all numbers between 0 and 1000 that are divisible by ,7​
    8·1 answer
  • An informative presentation can be used for conducting a classroom discussion.
    6·1 answer
  • Internet transportation exchanges brings together shippers who post __________ and carriers that post __________ in order to arr
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!