The following function is supposed to return -1 when x is negative, +1 when x is positive, or if x is zero. What, if anything, is wrong with the function? def plusMinusZero(x): if x == 0 : return 0 elif x <= 0 : return -1 else x >= 0 : return 1 A. A return statement must be added at the end of the function B. Both occurrences of elif must be replaced with if C. The <= and >= must be replaced with < and > D. Nothing is wrong with the function

Answers

Answer 1

def dx(fn, x, delta=0.001):

   return (fn(x+delta) - fn(x))/delta

def solve(fn, value, x=0.5, maxtries=1000, maxerr=0.00001):

   for tries in xrange(maxtries):

       err = fn(x) - value

       if abs(err) < maxerr:

           return x

       slope = dx(fn, x)

       x -= err/slope

   raise ValueError('no solution found')


Related Questions

Object oriented programming is categorized by use of:.

Answers

Answer:

OOP stands for Object Oriented Programming, a style of programming that incorporates the three features of encapsulation, polymorphism and inheritance.

Explanation:

You will be using your pH meter again for this experiment. If your pH meter stops working (or is no longer working), what are your options for troubleshooting

Answers

Answer:

If your pH meter does not work, there are other ways to find out the pH, the popular one being litmus paper or indicator paper, which changes color based on the acidic or basic -ness of the object being tested.

~

If you are using an incrementing variable to iterate over a list, the variable should be set to zero before the loop begins.

Answers

Answer:

It will be True

Why is it more beneficial to interact with your audience using hootsuite, rather than engaging natively from specific social accounts?.

Answers

Answer:

Hootsuite more accurately estimates the dollar value of a like, share, and retweet.

Hootsuite allows you to see the contents of private profiles, providing thorough and accurate customer insights.

Hootsuite has an ‘auto-engagement’ feature that interacts with your followers

Hootsuite lets you create specific streams to monitor social media engagements, and respond efficiently in one workspace

more accurately than social networks’ native AI functionality.

Who paid for the development of the internet, and why?.

Answers

Computer scientists whose research was heavily financed by the federal government, most notably through Darpa, the research arm of the Defense Department

What type of software permits a user to record video of what is occurring on the computer along with typed and cursor actions in order to create a lesson

Answers

The type of software which permits a user to record video of what is occurring on the computer along with typed and cursor actions in order to create a lesson is called screencast.

What is screencast?

The screencast is the software which used to record the video of the screen of a computer. These types of software are build for the following purpose.

Uses to record, what a one sees on his computer.Such type of software are used to create the lesson as the facility of audio narration is provided in it.This software is helpful for the student who prefer self study.Many education organizations create learning with different screencast software.

Thus, the type of software which permits a user to record video of what is occurring on the computer along with typed and cursor actions in order to create a lesson is called screencast.

Learn more about the screencast here;

https://brainly.com/question/15878080

#SPJ1

why aren't my skullcandy bluetooth headphones connecting to my school chromebook if I turned on both the headphones and the bluetooth on the chromebook???

I am so confused!! Please help!!! Will give you brainliest if answered correctly. Thank you!

Answers

The school could have a block on what’s allowed to be connected to the chrome books. If they don’t let you charge your phone on it then you can’t listen to music with it- My experience at least.

Answer:

It's most likely blocked.

Explanation: I don't know why they would need to block it, but okay.

The set of instructions that define how to display the html elements in your site is:.

Answers

Answer:

CSS

Explanation:

which dual-stack architecture allows ipv4 and ipv6 at the network layer to access a single tcp/udp stack

Answers

The dual-layer-IP allows ipv4 and ipv6 at the network layer to access a single tcp/udp stack.

What is the dual IP layer?

The word dual-stack is a word that connote a full or total duplication of all stages in the protocol stack ranging from its applications to the network layer.

Note that the dual-layer-IP method often gives room for a computer to run IPv4 and IPv6 simultaneously  at the network layer, and all of the IP stack can access a different TCP/UDP stack.

Learn more about  architecture  from

https://brainly.com/question/9760486

To make the most informed purchasing decision, you should:
• A. read descriptions to learn if the product has features you want.
• B. read online testimonials to see if others are happy with the
product.

C. look at how many people own the product to see if it is popular.
• D. watch a video from the manufacturer to find out the best features.

Answers

Answer:

its either A or B but im leaning more towards B

Explanation:

SHA-1 produces a(n) ___________-bit message digest, which can then be used as an input to a digital signature algorithm.

Answers

SHA-1 produces a(n) 160-bit message digest, which can then be used as an input to a digital signature algorithm.

What is SHA-1?

Secure Hash Algorithm 1 or SHA 1 is a function which take the input value. In the result, it produces the hash value of 20 byte.

As there is 8 bit in 1 byte. Thus, the number of bits in 20 byte are,

[tex]n=20\times8\\n=160\rm\; bits[/tex]  

Hence, it produces 160 bit of hash value, which is known as the massage digest.

Thus, SHA-1 produces a(n) 160-bit message digest, which can then be used as an input to a digital signature algorithm.



Learn more about the SHA-1 here;

https://brainly.com/question/9979590

#SPJ1

12. Fill in the blanks: In a ____________, the root of the tree is labeled _______________, children of the root are the names of _______________, and the leaves designate ___________. These trees help generate ____________ used to evaluate architectural alternatives. g

Answers

Based on the description of the tree, the missing words are:

Binary tree. Root node. Internal nodes. External node.Structure.

What are the parts of a binary tree?

In a Binary tree, the roots are called the root nodes and the children of those roots are called the internal nodes.

The leaves are meant to designate the external nodes. These trees are helpful in evaluating architectural alternatives because they provide structure.

Find out more on binary trees at https://brainly.com/question/14990156.

Vivian went to the gym and asked people if they like to exercise. To avoid bias in her survey, Vivian should

ask her survey question at another gym
count each tally mark as two people
use a bigger sample size
use a smaller sample size

Answers

ask her survey question at another gym

Vivian went to the gym and asked people if they like to exercise. To avoid bias in her survey, Vivian should ask her survey question at another gym. Thus, option A is correct.

What is a random sample?

Random sampling is the method of selecting the subset from the set to make a statical inference. An employee at a gym wants to select a random sample of gym members for a survey about their exercise habits.

The first is not a fluke. He's simply tasting the first gym attendees. The second is not a coincidence. He's just taking samples from one zip code. The third is completely random. He's generating numbers with a random number generator. The fourth is not a fluke. Only volunteers are being sampled.

Regular physical activity can improve your muscle strength and boost your endurance. Exercise delivers oxygen and nutrients to your tissues and helps your cardiovascular system work more efficiently. And when your heart and lung health improve, you have more energy to tackle daily chores.

Thus, option A is correct.

Learn more about exercise on:

https://brainly.com/question/30094654

#SPJ2

3. Q3: India is a user who needs to be able to see a list of the names of her friends (those whom she considers friends). There is already an account set up in the database for India. What do you need to do to give her the appropriate access to her list of friends

Answers

In order to grant India access to a list of her friends, you should use a query by selecting name from person and use the inner join relationship on person.

What is query?

A query refers to a computational request for data that are saved in a database table, from existing queries, or even from a combination of both a database table and existing queries.

In this scenario, you can grant India access to be able to see a list of her friends with a structured query language (SQL) by selecting name from person and use the inner join relationship on person.

Read more on query here: https://brainly.com/question/25266787

You have been hired as a security administrator. While analyzing your organization's personnel policies, you notice the presence of multiple orphaned accounts. How should you handle this situation

Answers

To deal with presence of multiple orphaned accounts as a security administrator in an organization, the user accounts should be disabled.

What is orphaned accounts?

The orphaned accounts are the accounts which do not have any valid business owner but provide the access to the services and corporate systems. One best way to deal with such account is to disable the user account.

Steps to deal with orphaned accounts-

Using the automated provisioning and deprovisioning can save the Control the accounts with micro-certification.Regular check of account to prevent the hidden access risk.

You have been hired as a security administrator. While analyzing your organization's personnel policies, you notice the presence of multiple orphaned accounts.

In such case, one should disable these accounts.

Thus, to deal with presence of multiple orphaned accounts as a security administrator in an organization, the user accounts should be disabled.

Learn more about the orphaned accounts here:

https://brainly.com/question/11211623

#SPJ1

Create code in HTML of a webpage that has an image that opens a page with the Wikipedia website when clicked. (Refer to Image)

Answers

Here is the Code.

you may need to change it a bit

Hopefully it Help you out :-)

Select the correct answer.
If a user clicks on the hyperlink generated by the following code, where will the web browser redirect the user?

Click here to go to first table

A.
a web page called “table1”
B.
a website with the search tag “table1”
C.
an element on the same page with the id “table1”
D.
a paragraph on the same page with the text “table1”

Answers

Answer:

A.

Explanation:

The hyperlink will send you whatever the link was.

Imagine that you are a professional white hat hacker, testing a company’s system to make sure they are ready for attacks. What method of attack (or combination of attacks) would you use? How does your motivation for hacking impact the type of attack that you employ? Discuss how you might approach hacking and how the motivation for your hacking impacts the methods you would use.

Answers

Answer:

A white hat hacker, or ethical hacker, uses penetration testing techniques to test an organization's information technology

Explanation:

A small software company is starting to work with the AWS Cloud. Which service will allow them to find, test, buy, and deploy software that runs on AWS

Answers

Answer:

Elastic Beanstalk

Explanation:

Elastic Beanstalk: AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker on familiar servers such as Apache, Nginx, Passenger, and IIS.

You have an unsorted array of 1,000,000
people.
You are using a Linear Search to look for
someone who is not in the array at all.
How many people does the computer look at
before it realizes this person is not in the array?
O a
b
Ос
Od
(a)exactly 1
(b)about 500,000
(c)all 1,000,000
(d) it will search forever
(d)It will search forever.

Answers

I’m pretty sure it’s C.

The ______ moving air alone will charge suspended particles and cause the buildup of static electrical charges on people and objects in the environment​

Answers

Answer:

friction

Explanation:

the resistance that one surface or object encounters when moving over another. Alsothe action of one surface or object rubbing against another.

In the digital signature technique when the whole message is signed using an asymmetric key, the sender of the message uses __________ to sign the message.

Answers

In the digital signature technique when the whole message is signed using an asymmetric key, the sender of the message uses his or her own private key to sign the message.

The sender of the message uses his or her own private key to sign the message.

Which kind of key is used for asymmetric encryption?

Asymmetric encryption is known to be a kind of public key encryption, but and it is one that is made up of key pair.

They are the public key and the private key and as such, In the digital signature technique when the whole message is signed using an asymmetric key, The sender of the message uses his or her own private key to sign the message.

Learn more about digital signature from

https://brainly.com/question/13041604

#SPJ2

A(n) ___________ is a notification from the operating system that an action has occurred, such as the user clicking the mouse or pressing a key.

Answers

Answer:

the answer is event

Explanation:

pls tell me if im wrong

Custom-built mini-programs that can execute a complicated series of commands in a tool like microsoft word or excel are called.

Answers

Custom-built mini-programs that can execute a complicated series of commands in a tool like Microsoft word or excel are called macros.

What is a macro program?

Macros are known to be a type of programs that functions by automating some commonly used processes or tasks that are found in the Excel.

Note that Custom-built mini-programs that can execute a complicated series of commands in a tool like Microsoft word or excel are called macros as a often  records day to day operations through the use of keystrokes or a mouse.

Learn more about  mini-programs from

https://brainly.com/question/24833629

#SPJ1

Which of the following CSS rules will select the HTML element with the id logo and set the font size for that element to 60 pixels?
i. logo {
font-size: 60px;
}
ii. logo {
font-size: 60px;
}
iii. logo {
font-size: 60px;
}
iv. id="logo" {
font-size: 60px;
}

Answers

The CSS rules that can select the HTML element with the id logo and set the font size for that element to 60 pixels is #logo {font-size: 60px.

What are HTML elements?

The <html> element is known to be the background or root element and it is one that tells more about the whole HTML document.

Note that in the above scenario, the option that will select the HTML element with the id logo and set the font size for that element to 60 pixels is #logo {font-size: 60px.This is because it will give the accurate form of what it is about.

Learn more about  HTML element  fromhttps://brainly.com/question/13164785

What is cloud computing?
O It is a way to store information on an independent server for access from any device.
O It is a way for people to consolidate their social media presence to one website.
O It is a way for users of social media to monitor the information they are making public.
O It is a way to predict complicated weather patterns using the Internet and a series of satellites.

Answers

Answer:O It is a way to store information on an independent server for access from any device.

Explanation:

Because its in the cloud the cloud isa type of software that stores data

Suggest 2 reasons why a system might maintenance after a while

Answers

Answer:

Prevention Against Viruses and Malware.

Speed up Your Computer.

Explanation:

Check My Work To create a link to a webpage, you insert code in a(n) _____ document that references the webpage by name and location.

Answers

To create a link to a webpage, the code insert in an HTML document that references the webpage by name and location.

What is HTML document?

HTML document is the file document which contains the HyperText Markup Language.  

Features of HTML document-

When the location of HTML document is on the web browser, it behaves as document object.This type of documents are saved in machine language tools.It is saved with the extension .htm or .html.HTML document which references the webpage by name and location.

Thus, to create a link to a webpage, the code insert in an HTML document that references the webpage by name and location.

Learn more about the HTML document here;

https://brainly.com/question/20280664

#SPJ1

A user installs a financial software package that requires cloud access. For some reason, the application fails to connect to the cloud server. What caused this issue

Answers

Answer:

A. Duplicate IP (Internet Protocol) address B. Incorrect host-based firewall settings C. Incorrect time D. Unresponsive service

Explanation:

A user installs a financial software package that requires cloud access. For some reason, the application fails to connect to the cloud server. What caused this issue? A. Duplicate IP (Internet Protocol) address B. Incorrect host-based firewall settings C. Incorrect time D. Unresponsive service

An attacker is preparing to perform what type of attack when the target vulnerabilities include headers and payloads of specific application protocols

Answers

An attacker is preparing to perform what Application attack  when the target vulnerabilities include headers and payloads of specific application protocols.

What Is an Application Attack?

An application attack is known to be a type of system attack which is made up of cyber criminals that is said to have access to any unauthorized points.

Note that this kind of Attackers are  the ones that start by  looking at the application layer, and then looking for any kind of application vulnerabilities that is found within the code.

Learn more about vulnerabilities from

https://brainly.com/question/25633298

Other Questions
how do i do 15, 16??? what kingdom are true bacteria in 4. What effects did the changes to television news and the move toward online news in the middle of the20th century have on newspapers? Do you believe that the renaissance would have evolved without the weakening of the Church? Why? A line passes through the pointa (-8,8) and (12,7) Where do social inequality come from? Evaluate homework and practice workbook answers geometry which is defined as a change in position for a time interval If x= 7 - 43 then find the value of (a) (x+1/x) rais to 2 b) x rais 2+1/x rais to 2 Jamal, Gary, Charlie, and Brian are going to stand in a line, one behind the other. In how many different ways can they stand in the line Find the surface area of the triangular prism shown below. If x is 6 and y is -2 whats the value of yx A ellos les _________ los perros.encantangustagustaraencanta Which is a coefficient matrix for the system of linear equations? Find the measure of angle 6 A rectangular prism has dimensions x units, 2x units, and x 8 units. which expression represents the surface area of the prism? 8x 16 square units 16x 32 square units 10x2 48x square units 2x3 16x2 square units Reverse masking forms a soft edge on the panel. TrueFalseTable of Contents (Auto body) Parte I: Translate the following sentences into Spanish using the expressions acabar de, ir a, or tener que 1.) I just ate pizza with my friends. ________________________________________________________________. 2.) Mrs. Watson is going to give a quiz in class today. ________________________________________________________________. 3.) Joe has to buy a new computer for his office. ________________________________________________________________. 4. 4.) Yinz (i.) just ran five miles. (millas) ________________________________________________________________ 5.) 5.) Mr. Smith just taught an interesting class. Solve the equation on theinterval [0, 27r).4(sin x)2 - 2 = 0 In "Two kinds," how do the mother's expectations of her daughter affect the story?O The narrator fears she can never be what her mother wants her to be, and to deal with these feelings, she rebels.The narrator becomes overconfident in her abilities and, as a result, fails to learn from the mistakes that she makes.The narrator is inspired by her mother's dreams for her and gains confidence as she discovers her natural talent for music.O The narrator resents being forced to take music lessons until she sees how much her family sacrifices to buy her a piano.