Question

1 a - int(input(Enter a: )) 2 b - int(input(Enter b: )) 3 C = int(input(Enter c: )) 4 5 # calculate xi and x2 6 x1 - (b
1: Compare output 1 A 0/6 Traceback (most recent call last): File main.py, line 6, in <module> x1 - (-b+math.sqrt (b**2-4*a
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Enter a: Enter b: Enter c: : b: 5 6 1 x1: -0.2 X2: -1.0

import math a=int(input(Enter a: )) b=int(input(Enter b: )) c=int(input(Enter c: )) x1=(-b-math.sqrt(b**2-4*a*c))/(2*a)

import math

a=int(input("Enter a: "))
b=int(input("Enter b: "))
c=int(input("Enter c: "))

x1=(-b+math.sqrt(b**2-4*a*c))/(2*a)
x2=(-b-math.sqrt(b**2-4*a*c))/(2*a)

print("x1:",x1)
print("x2:",x2)

Add a comment
Know the answer?
Add Answer to:
1 a - int(input("Enter a: ")) 2 b - int(input("Enter b: ")) 3 C = int(input("Enter...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I have this code for python: num = int(input()) if num == 0: print('No change') else:...

    I have this code for python: num = int(input()) if num == 0: print('No change') else: dol = num // 100 num %= 100 Quarters = num // 25 num %= 25 Dimes = num // 10 num %= 10 Nickels = num // 5 num %= 5 Pennies = num if dol > 0: if dol == 1: print('1 Dollar') if Dollars > 1: print(dol,'Dollars') if Quarters > 0: if Quarters == 1: print('1 Quarter') if Quarters > 1:...

  • Hi, can someone offer input on how to address these 4 remain parts the zybook python...

    Hi, can someone offer input on how to address these 4 remain parts the zybook python questions?   4: Tests that get_num_items_in_cart() returns 6 (ShoppingCart) Your output ADD ITEM TO CART Enter the item name: Traceback (most recent call last): File "zyLabsUnitTestRunner.py", line 10, in <module> passed = test_passed(test_passed_output_file) File "/home/runner/local/submission/unit_test_student_code/zyLabsUnitTest.py", line 8, in test_passed cart.add_item(item1) File "/home/runner/local/submission/unit_test_student_code/main.py", line 30, in add_item item_name = str(input('Enter the item name:\n')) EOFError: EOF when reading a line 5: Test that get_cost_of_cart() returns 10 (ShoppingCart)...

  • Need some explanation on what im doing wrong.? solved it, forgot to add strings # Get...

    Need some explanation on what im doing wrong.? solved it, forgot to add strings # Get N from the command line import sys N = int(sys.argv[1]) # Your code goes here if N == 100: print (Hit) else: print(Miss) use Conditions explained 2.5. Challenge == We will provide you with a number, N. . If N is equal to 100, output 'Hit' • otherwise, output 'Miss Remember that strings are case-sensitive! Check it! LAST RUN on 5/8/2020, 10:44:31 PM Program...

  • i have no lean break. so below is my way. can you fix it. Test Input...

    i have no lean break. so below is my way. can you fix it. Test Input Result print (read_number_list()) 999 [] print (read_number_list)) 1 Answer (penalty regime: 0, 10, 20, 30, 40, 50%) 1 def read_number_list(): alist = [] while True: - numberinput("") if number -999: 4 return a listl else: a_list.append (int (number)) 9 1e 12 Precheck Check Test Input Expected Got print (read_number_list()) 999 [] Runtime error** Traceback (most recent call last): File "prog.python3", line 29, in <module>...

  • Code is wrong: python parsing warm up. while(True): inp_str = input('Enter input string: ') if (inp_str...

    Code is wrong: python parsing warm up. while(True): inp_str = input('Enter input string: ') if (inp_str == 'q'): break; while inp_str.find(",")==-1: print('Error: No comma in string. ') inp_str=input('Enter input string: ')       s=inp_str.split(",") print('First word:'+ s[0].strip()) print('Second word:'+ s[1].strip()) print('\n') This is my code for a problem but the output is wrong and I dont know how to fix it (the top is the output im getting the bottom is what i am supposed to get) Enter input string:...

  • PYTHON, what am i doing wrong here jupyter fibo.pyv a few seconds ago File Edit View...

    PYTHON, what am i doing wrong here jupyter fibo.pyv a few seconds ago File Edit View Language 1 def add(n): 2 return n+2 In [546]: import fibo as fib k = fib.add(2) AttributeError Traceback (most recent call last) <ipython-input-546-5d91eeb591d2> in <module> 1 import fibo as fib ----> 2 k = fib.add(2) AttributeError: module 'fibo' has no attribute 'add

  • Programming language C Please go through this carefully. Needs function void add(int *a1, int n, int...

    Programming language C Please go through this carefully. Needs function void add(int *a1, int n, int *a2) Write a program addition.c that reads in an array (a1) of numbers, and creates a new array (a2) of numbers such that the first and last numbers of a1 are added and stored as the first number, the second and second-to-last numbers are added and stored as the second number, and so on. You need to check for even and odd length of...

  • Please Help with the code below not sure where my error is...Thanks. Program output displayed here:...

    Please Help with the code below not sure where my error is...Thanks. Program output displayed here: Davy's auto shop services Oil change -- $35 Tire rotation -- $19 Car wash -- $7 Car wax -- $12 Enter the first service from the menu: Traceback (most recent call last): File "main.py", line 9, in choice1 = input("Enter the first service from the menu: "); EOFError: EOF when reading a line Here is the code: # Type your code here services =...

  • c <- 100) (d !- e/8)); ut.println("cond-" + cond); if ((30> a + (int)Math.sqrt(b) d-a+b; else...

    c <- 100) (d !- e/8)); ut.println("cond-" + cond); if ((30> a + (int)Math.sqrt(b) d-a+b; else d-b-c System.out.println("d-"+d); 10) (e 10> a/ d)) 2. (10 pts) Assume that you want to use both an input file callled "myinput.txt" and an output file called "myoutput.txt" which are located in a folder called "mydata" on the g: drive. In the program below, fill in all the missing details so that you can read a series of values (one by one) from the...

  • CAN SOMEONE PLEASE EXPLAN FO ME WHATS WRONG WITH MY CODE WHEN EVEN I RUN IT...

    CAN SOMEONE PLEASE EXPLAN FO ME WHATS WRONG WITH MY CODE WHEN EVEN I RUN IT IT GIVE ME THIS MASSAGE IM USING python BTW Traceback (most recent call last):                                                                                                                                                 File "../resource/asnlib/public/RUN.py", line 20, in <module>                                                                                                                      exec(source_code, dict())                                                                                                                                                      File "<string>", line 60, in <module>                                                                                                                                          NameError: name 'total_rough_sod' is not defined ) from math import pi length = float(input('Enter Course Length:')) width = float(input('Enter Course Width:')) def calculate_smooth_sod(width): grean_area_raduis= (width/2)/2 total_smooth_sod=2*pi*(grean_area_raduis**2) return total_smooth_sod def calculate_sand_trap_area(width): sand_trap_radius=(width/3)/2 sand_trap_area=pi*(sand_trap_radius**2) return sand_trap_area def calculate_rough_sod(length,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT