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
Help ne please!! Even if I press 3 times it doenst work.. when I try to turn it off either. Any suggestions? (using ipad)​
arlik [135]

Answer: Have you tried restarting your ipad or Shutting down? Or closing your ipad and waiting for a little bit so It can leave Or you can try Pressing it harder.

Explanation:

Thats all I have to help

8 0
3 years ago
Choose a firewall that is currently on the market and write a technical "sales pitch" to your classmates on why they should choo
stellarik [79]

Answer:

I would propose Comodo Firewall to my schoolmate. It is very easy to understand and have an appealing graphical UI. It gives the most significant level of security from dangers. It checks all the traffic going to the framework and leaving the framework. It quickly cautions you when there is any sort of suspicious action. There are no mind boggling design issues. It learns the conduct of the client to convey customized protection. It gives you the usefulness of Spyware filtering and infection checking in a single tick. There are a lot more functionalities that the firewall gives to its clients.

Explanation:

Choose a firewall that is currently on the market and write a technical "sales pitch" to your classmates on why they should choose the firewall you are selling.

I would propose Comodo Firewall to my schoolmate. It is very easy to understand and have an appealing graphical UI. It gives the most significant level of security from dangers. It checks all the traffic going to the framework and leaving the framework. It quickly cautions you when there is any sort of suspicious action. There are no mind boggling design issues. It learns the conduct of the client to convey customized protection. It gives you the usefulness of Spyware filtering and infection checking in a single tick. There are a lot more functionalities that the firewall gives to its clients.

3 0
3 years ago
A company wants to use online methods to target more customers. It decides to conduct a market research by collecting the data o
Ronch [10]

Answer:

They could use a CRM

A CRM tool lets you store customer and prospect contact information, identify sales opportunities, record service issues, and manage marketing campaigns, all in one central location — and make information about every customer interaction available to anyone at your company who might need it.

They Could Use PDC

The term “primary data” refers to data you collect yourself, rather than data you gather after another party initially recorded it. Primary data is information obtained directly from the source. You will be the first party to use this exact set of data.

They Could Use Quantitative vs. Qualitative Data

Quantitative data comes in the form of numbers, quantities and values. It describes things in concrete and easily measurable terms. Examples include the number of customers who bought a given product, the rating a customer gave a product out of five stars and the amount of time a visitor spent on your website.

Why Should I Track Users Data:

To ensure it's going smoothly, it's important to keep track of data that directly correlates to the potential success of your business. Key performance and financial metrics can help you address any problems with your business before they occur

8 0
2 years ago
Given a high-level code you should be able to write the corresponding MIPS assembly code. Simple loop in C; A[ ] is an array of
nevsk [136]

Answer:

Explanation:

The code for the given problem is written below

.data

A : .word 1 2 3 4 5 6 7 8 9 10

.text

la $s5,A

li $s1,0 # load g

li $s2,10 # load h

li $s3,0 # load i

li $s4,1 # load j

loop:

mul $s6,$s3,4

add $s6,$s6,$s5 #address of A[i]

lw $s6,($s6) #get value of A[i] in s3

add $s1,$s1,$s6 #g = g+A[i]

add $s3,$s3,$s4 # i = i+j

bne $s3,$s2,loop #if i!=h jump to loop

4 0
2 years ago
This is a type race kindly join.
xeze [42]

Answer:

NO THANKS FOR THAT I WILL NOT JOIN

8 0
3 years ago
Other questions:
  • Your bank offers to lend you $114,400 at an 8.5% annual interest rate to start your new business. The terms require you to amort
    11·1 answer
  • Write a function M-file that takes as input two matrices A and B, and as output produces
    8·1 answer
  • Create a simple main() that solves the subset sum problem for any vector of ints. Here is an example of the set-up and output. Y
    12·1 answer
  • The first computer (the eniac was how big
    8·1 answer
  • The Chart below from Google Trends shows the prevelance of some search terms in the United States between 2004 and the present.
    8·1 answer
  • Universal Containers has two customer service contact centres and each focuses on a specific product line. Each contact centre h
    7·1 answer
  • + Use for loop to print numbers from 100 to 10
    11·1 answer
  • Please help me and solution in c language​
    5·1 answer
  • What is the output of the following program? If there is any problem, how can
    13·1 answer
  • A debate about city schools are more better than village schools​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!