g python Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

Answers

Answer 1

The sum of even-valued terms in the Fibonacci sequence up to four million is 4613732.

We need to find the sum of even-valued terms that do not exceed four million. First, we need to generate the Fibonacci sequence up to four million.

Then, we can iterate through the sequence and add the even-valued terms together.

Finally, we return the sum of the even-valued terms.

Here's the code for it:

```pythonfib = [1, 2] # First two terms of the Fibonacci sequencewhile fib[-1] < 4000000: # Loop until the last term is greater than or equal to 4 millionfib.append(fib[-1] + fib[-2]) # Add the last two terms and append the result to the sequenceeven_sum = 0 # Initialize the sum of even-valued termsfor term in fib: # Iterate through the Fibonacci sequenceif term % 2 == 0: # Check if the term is eveneven_sum += term # Add the even-valued term to the sumprint(even_sum) # Print the sum of even-valued terms```

The output will be:```4613732```

Learn more about Fibonacci sequence at:

https://brainly.com/question/14253617

#SPJ11


Related Questions

A music producer is recording a soundtrack for a new television wildlife programme that is being produced in collaboration with the OU. The music producer wishes to use a sampling rate of 96 kHz with each sample being 3 bytes of data. The recording is being made on a single (mono) channel. i. How many bits are there in each sample? ii. How many bits per second are processed while the music is being recorded? Express your answer in scientific notation to 3 significant figures. iii. One piece of music is 5 minutes 10 seconds long, how many bits are processed in total? Express your answer in scientific notation to 3 significant figures. iv. If the sampling rate is reduced to 24 kHz how many bits will be processed using the same piece of music? Express your answer in scientific notation to 3 significant figures. v. What is the percentage decrease in the number of bits processed as a result of reducing the sampling rate from 96 kHz to 24 kHz. Express your answer to 2 decimal places.

Answers

i. Each sample consists of 24 bits of data.ii. The processing rate while recording is 2.304 x 10^6 bits/s.iii. The total number of bits processed for a 5 minutes 10 seconds music piece is 7.1344 x 10^8 bits.iv. If the sampling rate is reduced to 24 kHz, the number of bits processed is 5.76 x 10^5 bits.v. The percentage decrease in the number of bits processed is 75%.

i. Each sample consists of 3 bytes of data, and since 1 byte is equal to 8 bits, there are 3 * 8 = 24 bits in each sample.

ii. The sampling rate is 96 kHz, which means 96,000 samples are processed per second. Since each sample is 24 bits, the number of bits processed per second is 96,000 * 24 = 2,304,000 bits/s.

iii. The duration of the music is 5 minutes 10 seconds, which is equivalent to 310 seconds. Since there are 2,304,000 bits processed per second, the total number of bits processed is 2,304,000 * 310 = 713,440,000 bits.

iv. If the sampling rate is reduced to 24 kHz, the number of samples processed per second becomes 24,000. With each sample still being 24 bits, the number of bits processed per second is 24,000 * 24 = 576,000 bits/s.

v. The percentage decrease in the number of bits processed is given by ((original bits - new bits) / original bits) * 100. Substituting the values, ((2,304,000 - 576,000) / 2,304,000) * 100 = 75%.

To know more about original bits visit :

https://brainly.com/question/33445462

#SPJ11

Critically discuss ‘the use, what and how’ of technology which British American Tobacco S. A can use to facilitate knowledge management practices to enhance organizational efficiency and effectiveness

Answers

To improve their operational performance efficiently, organizations must embrace the use of technology in managing knowledge.

Why is this so?

British American Tobacco S.A could integrate a range of technological solutions - including , collaboration applications, and online knowledge sharing platforms to capture, store & share critical organizational information amongst workers.

Incorporating these technologies would optimize decision-making capacity by ensuring timely access to relevant materials while boosting workforce productivity.

Also organizational leaders must prioritize maintaining employee privacy and upholding ethical guidelines when implementing digital solutions.

Learn more about Technology at:

https://brainly.com/question/9171028

#SPJ4

Which attribute allows you to create a hyperlink?
need answer now

Answers

Answer:

the href attribute

Explanation:

The chief security officer (CSO) is responsible for ensuring the security of MIS systems and develop- ing strategies and MIS safeguards against attacks from hackers and viruses.

Answers

The chief security officer (CSO) plays a critical role in an organization by overseeing the security of Management Information Systems (MIS). Their primary responsibility is to develop and implement strategies to safeguard the MIS systems from potential threats such as hackers.

As organizations increasingly rely on technology and digital systems, the role of the chief security officer (CSO) becomes crucial in maintaining the security of Management Information Systems (MIS). The CSO is responsible for formulating strategies and implementing safeguards to protect the MIS systems from various security threats.

One of the primary tasks of the CSO is to assess potential risks and vulnerabilities in the MIS systems. This involves conducting risk assessments, identifying potential attack vectors, and staying updated with the latest security threats and trends. Based on these assessments, the CSO develops strategies and plans to mitigate risks and protect the systems from unauthorized access, data breaches, malware, and other security incidents.

The CSO also plays a key role in developing and implementing security policies and procedures. They ensure that the organization has appropriate security controls in place, such as access controls, encryption mechanisms, intrusion detection systems, and firewalls. The CSO may also oversee security awareness training programs for employees to educate them about best practices and potential security risks.

In addition to preventive measures, the CSO is responsible for incident response and management. They establish protocols for detecting, investigating, and responding to security incidents promptly. This includes coordinating with internal teams, external security experts, and law enforcement agencies if necessary.

Overall, the CSO's role is vital in protecting the organization's sensitive data, maintaining the trust of customers and stakeholders, and ensuring the smooth and secure operation of Management Information Systems.

know more about chief security officer (CSO) :brainly.com/question/29608343

#SPJ11

The Roles and Responsibilities of MIS Drag the correct MIS title to its associated responsibilities. Chief Technology Officer Chief Privacy Officer Chief Knowledge Officer Chief Information Officer Chief Security Officer Responsible for ensuring the security of business systems and developing strategies and safeguards against attacks by hackers and viruses.

what is a iteration in program code?​

Answers

Answer:

it's when the code keeps repeating e.g while loop

Explanation:

Which of the following is the fastest computer processing speed?
Group of answer choices

bytes

megahertz

megabytes

gigahertz

Answers

Answer: Gigahertz

Explanation: One megahertz is equal to one million cycles per second, while one gigahertz equals one billion cycles per second.

This means a 1.8 GHz processor has twice the clock speed of a 900 MHz processor.

Takes a 3-letter String parameter. Returns true if the second and
third characters are “ix”

Python and using function

Answers

Answer:

def ix(s):

   return s[1:3]=="ix"

Explanation:

PLEASE HELP WITH MY COMPUTER
this thing is popped up and it's annoying. I'm on a HP laptop how do i get rid of it?​

PLEASE HELP WITH MY COMPUTERthis thing is popped up and it's annoying. I'm on a HP laptop how do i get

Answers

Answer:

Escape or turn it off then back on??

Explanation:

I'm not very sure what is going on but idfk

consider a class that uses the following variables to implement an array-based stack: string [ ] s = new string[100]

Answers

The given code represents a class that is utilizing an array-based stack that uses the following variables: string[] s = new string[100].Here, `string[] s` is an array of strings that can hold up to 100 elements. By using this array, an array-based stack can be implemented.

An array-based stack is a simple data structure that uses an array as its primary storage device. Elements are inserted and deleted from the top of the stack. As a result, the stack can be implemented using an array in which the top element is stored at the last index of the array. `Push()`, `Pop()`, and `Peek()` are the most typical operations in a stack. `Push()` - This operation adds an element to the top of the stack.

`Pop()` - This operation removes the element from the top of the stack .`Peek()` - This operation returns the top element of the stack without removing it .In the provided code, the following procedures can be used to implement the above operations :

public void Push(string value)if (top == 99) Console .WriteLine("Overflow error!");

else s[++top] = value;

public string Pop()if (top == -1) { Console. WriteLine("Underflow error!");

return null; }

else { return s[top--]; }

public string Peek()if (top == -1) { Console .

WriteLine("Underflow error!");return null; }else { return s[top]; }

Note: In this code, `top` represents the index of the top element in the stack. When no element is in the stack, `top` is set to `-1`.

To learn more about array-based stack:

https://brainly.com/question/32290335

#SPJ11

Which feature is used to change how a presentation moves from slide to slide?

Answers

Answer:

Click Slide Sorter on the View menu. On the Window menu, click Arrange All to display both presentations. Click the slide you want to move, and drag it to the other presentation. If you want to copy the slide across then hold down Ctrl as you drag the slide.

Explanation:

Persuasion is when Someone speaks to crowd about love
○True
○False​

Answers

false i think is the answer

Six weeks after Samuel purchased six portable computers for his realty business, he was called by the retailer who sold him the computer and asked if he was happy with the purchase and if there were anything that he would change about the way the store does business. The computer retailer was trying to reduce its _____ gap.

Answers

The correct answer is The computer retailer was trying to reduce its communication gap by following up with Samuel to see if he was satisfied.

with his purchase and if there was any way they could improve their business practices. The communication gap refers to the difference between the actual service provided by the company and the service that the company promises to deliver to the customers. By actively seeking feedback from Samuel, the computer retailer is attempting to close this gap and improve their overall customer satisfaction. after Samuel purchased six portable computers for his realty business, he was called by the retailer who sold him the computer and asked if he was happy with the purchase and if there were anything that he would change about the way the store does business.

To learn more about computer click the link below:

brainly.com/question/15227575

#SPJ11

how do we calculate CRF, which needs all possible sequence of labels of length n?

Answers

In Conditional Random Fields (CRFs), the likelihood of a set of N training instances is determined as the product of the individual likelihoods of each

The CRF which is also referred to as a  power function is used for developing a CRF model, which is able to anticipate fresh examples in any case. Based on the relations among the labels in the training data, the model will generate a set of labels for the new cases.

They can be based on a number of variables, such as the distance between illustrations in the sequence, the resemblance of their labels, or the context in which they appear determining the product of individuals.

Learn more about a product, here:

https://brainly.com/question/30340079

#SPJ4

an individual who provides their data has the right to know and understand all of the data-processing activities and algorithms used on that data. this is called ownership.

Answers

Individual providing their data has the right to be informed and understood all of the data processing activities and algorithms used on their data. This is called ownership. This is a false statement.

All data processing activities and algorithms must be completely explainable, known, and understood by the individual who provides their data is called transaction transparency. Transaction transparency ensures that everything that has been done on data is shown to the person to whom the data belongs.

Thus, the given scenario in this question represents the concept of transaction transparency, not ownership. For this reason, the given statement is false.

"

Complete question

an individual who provides their data has the right to know and understand all of the data-processing activities and algorithms used on that data. this is called ownership.

True

False

"

You can learn more about transaction transparencyat

https://brainly.com/question/29890998

#SPJ4

What are 2 ways to send a message to your client when signed in as an accountant user?.

Answers

Answer:

The use of Ask client and request are 2 ways to send a message to your client when signed in as an accountant user.

Why does my smoke detector keep beeping even after i change the battery?.

Answers

Sometimes they just beep for no reason or the batteries are faulty

To troubleshoot a smoke detector that continues beeping after a battery change, check the battery installation, clean the detector, consider replacing it if it's old, and consult the manufacturer or customer support if needed.

The objective of this question is to seek assistance in troubleshooting a smoke detector that continues to beep after a battery change.

There could be a few reasons why it's still beeping even after you've changed the battery.

First, make sure that you've installed the new battery correctly. Double-check the battery compartment to ensure it's securely in place and the contacts are making good contact.

It's also a good idea to use a high-quality battery to ensure optimal performance.

Another possibility is that there might be some residual smoke or dust particles inside the smoke detector, causing it to detect a false alarm. Try gently cleaning the detector using a soft brush or compressed air to remove any debris that may be interfering with its operation.

Additionally, it's worth checking if the smoke detector itself needs to be replaced.

Over time, smoke detectors can age and become less reliable. If your smoke detector is more than 10 years old, it may be time to invest in a new one for optimal safety.

If none of these suggestions solves the issue, it might be best to consult the manufacturer's instructions or contact their customer support for further assistance.

To learn more about troubleshooting visit:

https://brainly.com/question/29736842

#SPJ3

Fill in the blank with the correct response.
People in STEM careers are considered
thinkers who reach conclusions through sound judgment and reasoning
Save and Exit
Next
What goes in the blank between considered and thinkers

Answers

Answer:

logical

Explanation:

Answer:

logical thinkers

Explanation:

they are logical thinkers because they know whats going on


Why is John Von Neumann to a remarkable name?
si​

Answers

Answer:

John von Neumann is remarkable for his vast knowledge of mathematics, and the sciences as well as his ability to correlate the pure and applied sciences.

Explanation:

John von Neumann who was born on December 28 1903, and died on February 8,1957 was known for his extensive knowledge of mathematics, physics, computer, economics, and statistics. In computing, he was known to conceive the idea of the self-replicating machines that thrive in the automata cellular environment, the von Neumann architecture, stochastic computing and linear programming.

He developed the game theory in Economics, and laid the foundation for several mathematical theories. He contributed greatly to quantum mechanics and quantum physics. Little wonder, he was dubbed "the last representative of the great mathematicians."

What is the mistake in this python code

emotion = input("How are you feeling today?")
print(f"Im feeling {emotion} too!")

if == sad:
print("I hope you have a good day")

if == happy:
print("Me too")

Answers

You will need to set the if statements to:

if emotion == "sad":

   print("I hope you have a good day")

if emotion == "happy":

   print("Me too")

Make sure to indent the print code, and the first part of your code is correct!

The mistake in this Python code is that the if statements are missing the variable name that they should be checking. The correct syntax for an if statement is `if condition:` where `condition` is some expression that evaluates to either True or False.

Also, the values `sad` and `happy` are not defined as strings in the code, so the comparison with these values will result in a NameError.

Here's the corrected code:

emotion = input("How are you feeling today?")

print(f"I'm feeling {emotion} too!")

if emotion == "sad":

   print("I hope you have a good day.")

   

if emotion == "happy":

   print("Me too.")

Note that I've added the variable name `emotion` to the if statements, and defined the comparison values as strings. Also, I've added indentation to the print statements so they are executed only when the condition is true.

a data analyst uses to decide which data is relevant to their analysis and which data types and variables are appropriate.a data analyst uses to decide which data is relevant to their analysis and which data types and variables are appropriate.

Answers

A data analyst uses data selection and data preprocessing techniques to decide which data is relevant to their analysis and which data types and variables are appropriate.

Data selection involves identifying and extracting relevant data from a larger dataset or multiple datasets. This may involve filtering out irrelevant data, combining data from different sources, or sampling data to reduce its size while maintaining its representativeness.

Data preprocessing involves transforming the selected data into a format that is suitable for analysis. This may involve cleaning the data to remove errors or inconsistencies, transforming the data to normalize its distribution, or reducing the dimensionality of the data to focus on the most important variables.

In addition to data selection and preprocessing, data analysts may also use statistical and machine learning techniques to analyze the data and extract insights. These techniques may involve modeling the relationships between variables, identifying patterns or trends in the data, or making predictions or recommendations based on the data. However, selecting and preprocessing the data is a crucial first step in the data analysis process, as it helps ensure that the analysis is based on relevant and appropriate data.

Analog circuits are subject to noise that can distort their output. are digital circuits immune to noise? discuss your answer.

Answers

Digital circuits are not completely immune to noise, although they are more resistant to it compared to analog circuits. Noise can still affect the performance of digital circuits, but it is less likely to cause significant distortion or errors in their output. Here's why:
    Digital circuits use discrete levels of voltage to represent binary data (0s and 1s). These voltage levels are typically well-defined, allowing digital circuits to distinguish between different states with high accuracy. As a result, small variations in the input signal caused by noise are less likely to be misinterpreted.
    Digital circuits often employ error detection and correction techniques to mitigate the impact of noise. For example, the use of parity bits or more advanced error correction codes can help identify and correct errors introduced by noise. This improves the reliability of digital circuits, making them more robust against noise-induced disturbances.
     Digital circuits can use buffering and amplification techniques to strengthen signals and reduce the impact of noise. These techniques involve isolating the circuit from external noise sources and using amplifiers to boost weak signals. As a result, the signals in digital circuits are less susceptible to interference and can maintain their integrity even in the presence of noise.
     Additionally, digital circuits can take advantage of synchronous operation, where signals are synchronized using clock signals. This synchronization helps in accurately sampling and interpreting the input signals, reducing the influence of noise.
   However, it is important to note that digital circuits can still be affected by certain types of noise, such as electromagnetic interference (EMI) or crosstalk. These can introduce errors or cause signal degradation in digital circuits. Therefore, while digital circuits are more immune to noise compared to analog circuits, they are not completely immune.

    In conclusion, while digital circuits are more resistant to noise compared to analog circuits, they are not completely immune.                                                                                                                                                                                                                                       However, the use of discrete voltage levels, error detection and correction techniques, buffering and amplification, and synchronous operation help digital circuits mitigate the impact of noise and maintain reliable performance.

To know more about synchronization visit:

https://brainly.com/question/28166811

#SPJ11

How did tribes profit most from cattle drives that passed through their land?
A.
by successfully collecting taxes from every drover who used their lands
B.
by buying cattle from ranchers to keep for themselves
C.
by selling cattle that would be taken to Texas ranches
D.
by leasing grazing land to ranchers and drovers from Texas

Answers

The way that the tribes profit most from cattle drives that passed through their land is option D. By leasing grazing land to ranchers and drovers from Texas.

How did Native Americans gain from the long cattle drives?

When Oklahoma became a state in 1907, the reservation system there was essentially abolished. In Indian Territory, cattle were and are the dominant economic driver.

Tolls on moving livestock, exporting their own animals, and leasing their territory for grazing were all sources of income for the tribes.

There were several cattle drives between 1867 and 1893. Cattle drives were conducted to supply the demand for beef in the east and to provide the cattlemen with a means of livelihood after the Civil War when the great cities in the northeast lacked livestock.

Lastly, Abolishing Cattle Drives: Soon after the Civil War, it began, and after the railroads reached Texas, it came to an end.

Learn more about cattle drives from

https://brainly.com/question/16118067
#SPJ1

which of the following are benefits of the domain name system (dns)? select all that apply. 1 point it provides addresses that are easier for people to remember. it helps automate network configuration. it assigns internet protocol (ip) addresses. it provides network address translation (nat).

Answers

The correct answers are:

It provides addresses that are easier for people to remember.It helps automate network configuration.

The benefits of the Domain Name System (DNS) include:

It provides addresses that are easier for people to remember: DNS enables the mapping of domain names (e.g., www.stat.com) to their corresponding IP addresses. This allows users to access websites or services using human-readable domain names instead of having to remember complex IP addresses.It helps automate network configuration: DNS simplifies network configuration by automatically resolving domain names to IP addresses. Instead of manually configuring IP addresses for each device or service, DNS enables automated lookup and resolution of domain names, making network administration more efficient.It assigns Internet Protocol (IP) addresses: DNS does not directly assign IP addresses, but it plays a critical role in the resolution of domain names to their associated IP addresses. DNS servers store and distribute IP address information, facilitating the proper routing and delivery of network traffic.

To know more about Domain Name System (DNS)

brainly.com/question/32768737

#SPJ11

A good information that contains the facts necessary for decision makers to solve a problem is characterized by the __________.

a. accuracy
b. completeness
c. consistency
d. reliabilty
e. uniqueness

Answers

Answer: i believe its d:reliability

Explanation:

I think answer is no.D in my opinion

PLEASE ANSWER (CODING IN PYTHON)


Ask what kind of pet the user has. If they enter cat, print “Too bad...”, if they enter

dog, print “Lucky you!" (You can change the messages if you like). Once this works,

add other pets. (Iguana, Pig, Rabbit...)

Answers

Answer:

Explanation:

a = input("what kind of pet the user has")

if a == 'cat':

  print("Too bad")

elif a == 'dog':

   print("Lucky you!")

The program based on the information is given below.

What's the program about?

def main():

   pet = input("What kind of pet do you have? ").lower()

   if pet == "cat":

       print("Too bad...")

   elif pet == "dog":

       print("Lucky you!")

   elif pet == "iguana":

       print("That's interesting!")

   elif pet == "pig":

       print("Oink oink!")

   elif pet == "rabbit":

       print("Hop hop!")

   else:

       print("I'm not familiar with that pet.")

if __name__ == "__main__":

   main()

Learn more about program

https://brainly.com/question/26642771

#SPJ2

how to get vector to call nondefault constructor

Answers

To get a vector to call a nondefault constructor, you can use the "emplace_back" method instead of "push_back". The "emplace_back" method constructs an object in-place at the end of the vector, using the arguments passed to it to call the nondefault constructor.

To create a vector that calls a non-default constructor, you can use the std::vector constructor that takes two arguments:

std::vector<MyClass> myVector(numElements, MyClass(constructorArgs));

In the above example, MyClass is the class you want to store in the vector, numElements is the number of elements you want to create, and constructorArgs are the arguments you want to pass to the constructor of MyClass.

For example, if you have a class Person with a constructor that takes a name and an age, you can create a vector of Person objects as follows:

std::vector<Person> people(3, Person("John Doe", 30));

This creates a vector of three Person objects, each initialized with the name "John Doe" and age 30.

To learn more about constructor; https://brainly.com/question/13267121

#SPJ11

A user calls the helpdesk and states that they are receiving an IP conflict error on their computer. The user is on a company network that uses DHCP. The technician verifies the PC is using DHCP to obtain TCP/IP settings. Which of the following commands should the helpdesk technician use to resolve this issue? (Select two.)
A. IPCONFIG /REGISTERDNS
B. IPCONFIG /FLUSHDNS
C. IPCONFIG /RELEASE
D. IPCONFIG /RENEW
E. IPCONFIG /ALL

Answers

Answer:

a

Explanation:

none

A walk-through of the project deliverable is conducted by
__

Answers

A walk through of the project deliverable is conducted by: the sellers agent

A small amount of data generated by a website and saved by your web browser is called a.

Answers

Answer:

Its the Storage i think.

Explanation:

python

how do I fix this error I am getting

code:

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("")


equation.set("")

if __name__ == "__main__":
gui = Tk()



gui.geometry("270x150")

equation = StringVar()

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=l, width=7)
buttonl.grid(row=2, column=0)

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

button3 = Button(gui, text=' 3', fg='black', bg='white',command=lambda: press(2), height=l, width=7)
button3.grid(row=2, column=2)

button4 = Button(gui, text=' 4', fg='black', bg='white',command=lambda: press(2), height=l, width=7)
button4.grid(row=3, column=0)
button5 = Button(gui, text=' 5', fg='black', bg='white',command=lambda: press(2), height=l, width=7)
button5.grid(row=3, column=1)
button6 = Button(gui, text=' 6', fg='black', bg='white',command=lambda: press(2), height=l, width=7)
button6.grid(row=3, column=2)
button7 = Button(gui, text=' 7', fg='black', bg='white',command=lambda: press(2), height=l, width=7)
button7.grid(row=4, column=0)
button8 = Button(gui, text=' 8', fg='black', bg='white',command=lambda: press(2), height=l, width=7)
button8.grid(row=4, column=1)
button9 = Button(gui, text=' 9', fg='black', bg='white',command=lambda: press(2), height=l, width=7)
button9.grid(row=4, column=2)
button0 = Button(gui, text=' 0', fg='black', bg='white',command=lambda: press(2), height=l, width=7)
button0.grid(row=5, column=0)


Add = Button(gui, text=' +', fg='black', bg='white',command=lambda: press("+"), height=l, width=7)
Add.grid(row=2, column=3)

Sub = Button(gui, text=' -', fg='black', bg='white',command=lambda: press(2), height=l, width=7)
Sub.grid(row=3, column=3)

Div = Button(gui, text=' /', fg='black', bg='white',command=lambda: press("/"), height=l, width=7)
Div.grid(row=5, column=3)

Mul = Button(gui, text=' *', fg='black', bg='white',command=lambda: press("*"), height=l, width=7)
Mul.grid(row=4, column=3)

Equal = Button(gui, text=' =', fg='black', bg='white',command=equalpress, height=l, width=7)
Equal.grid(row=5, column=2)

Clear = Button(gui, text=' Clear', fg='black', bg='white',command=clear, height=l, width=7)
Clear.grid(row=5, column=1)

Decimal = Button(gui, text=' .', fg='black', bg='white',command=lambda: press("."), height=l, width=7)
buttonl.grid(row=6, column=0)

gui.mainloop()

Answers

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!

pythonhow do I fix this error I am gettingcode:from tkinter import *expression = "" def press(num): global
Other Questions
Write a linear function g wth g(0)-9 and g(x)=7. Which parent function is represented by the graph A the absolute value parent function B quadratic parent function C the linear parent functionD and exponential parent function Please someone help me 6, PLS HELP ME I RLLY NEED IT 20 POINTS Cosmic background radiation detected in space is believed to be evidence that:1-The universe began with an explosion2-The universe is contracting3-All matter in the universe is stationary4-Galaxies are evenly spaced throughout the universe Can i please have help with this THE TALE OF TONYO THE BRAVE Does the author use any literary devices, such as metaphor, simile, or alliteration? Hello ! I can not solve this problem of equations can you help me please.Three mobile operators offer, for the same phone, the following rates :Operator A: 120 per phone and 20 per month subscription.Operator B: 40 per phone and 25 per month subscription.Operator C: 10 per phone and 30 per month subscription.1) Complete: the one who will keep his phone for a long time will choose the operator ..., the one who will keep his phone for a short time will choose the operator ... and the operator ... is an intermediate choice. 2) Calculate the number of months for which each operator is advantageous.Thanks in advance for your help ! The ratio of dogs to cats at the veterinarian's office on Saturday. was 6 to 5. If there were 15 cats at the office, how many dogs and cats were there altogether? 20>5 + 2n - 9Plz help me with this Read the image for instructions This is a circumscribed polygon Glven: -7x < -21. Choose the solution set. what is a non example of rebellion ? Sophia was fascinated while studying the role of oceans in the hydrosphere. She decided to illustrate the features of the ocean floor on a poster for her part in a group project. Identify and describe the kinds of features found on the ocean floor. What type of molecule is shown below?SH-C=C-CH2-CH3O A. An alkene-alkyneOB. An alkane-alkyneOC. An alkyneO D. An alkane In a recent Game Show Network survey, 30% of 5000 viewers are under 30. What is the margin of error at the 99% confidence interval? Using statistical terminology and a complete sentence, what does this mean? (Use z*=2. 576)Margin of error: Interpretation: Help! Hurry!!! NO SPAM!!!!!!!! I will mark brainliest if you get it correct, and show your work. Determine whether f is an exponential function of x. If so, find the constant ratio. If (x+1,10)=(4,2y) then find the value of x & y Jack and Jill Forensics Style Answer the following questions based on information in the Crime Scene S.P.O.T.1. Identify several key pieces of evidence within the story. How were they useful to investigators?2. What evidence in the story is class evidence and what evidence is individual? Explain.3. How can Locard's exchange principle help investigate in this case?4. Choose a fairy tale or nursery rhyme story as the basis for your own forensic story. Be sure to include details about evidence. In 5-7 sentences, choose 1 popular fairytale (give the title and state the evidence etc)I add the information!!! Marco made a rectangular prism using 12-meter cubes. The rectangular prism has a volume of 5 m3. How many cubes did Marco use?Explain how you found the number of cubes.