To write a function that computes an expression and returns its result
Write a function that computes one of the roots of a quadratic equation. In addition to multiplying b by itself, you can compute b*b using the b** with the ** operator. The math.sqrt() method takes a single parameter, which is the number whose root should be computed, and returns the result. Now complete the code to compute one of the roots of the quadratic formula
Enter your Ursinus netid before clicking run. This is not your ID number or your email. For example, my netid is wmongan (non Ursinus students can simply enter their name to get this to run, but they won't get an e-mail record or any form of credit).
Netid
Clicking Run below will check your work and, if it passes, will submit your work automatically. You must be connected to the VPN for submission to be successful! You will receive a copy of your code via e-mail, so you'll know that it was submitted if you receive that e-mail! VPN access requires Multi-Factor Authentication, which sends you a code when you log into the network. Instructions on configuring these for your account can be found here.
quadratic.py
1
2
3
4
5
6
7
importmath
defget_quadratic_roots(a, b, c):
"""
Compute the right root of of the quadratic equation