Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 4 - Selections - Programming Exercises - Page 121: 4.3

Answer

$Code:$

Work Step by Step

$Statement:$ Write a program that prompts the user to enter a, b, c, d, e, and f and display the result. If ad – bc is 0, report that the equation has no solution. $Code:$ a = int(input("Enter a:")) b = int(input("Enter b:")) c = int(input("Enter c:")) d = int(input("Enter d:")) e = int(input("Enter e:")) f =int(input("Enter f:")) if ((a * d - b * c) == 0): print("the equation has no solution") else: x = ((e * d) - (b * f)) / ((a * d) - (b * c)) y = ((a * f) - (e * c)) / ((a * d) - (b * c)) print("x is {} and y is {}".format(x,y)) $Output:$
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.