summarylogtreecommitdiffstats
path: root/citardauq.py
blob: dbb9c70db8412e8c97f118d425f5685a02b9af3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import cmath, sys

if len(sys.argv) != 4:
    print("Please enter a, b, and c as arguments.")


else:

    a = float(sys.argv[1])
    b = float(sys.argv[2])
    c = float(sys.argv[3])

    print('a is', a, 'b is', b, 'c is', c)

    d = (b ** 2) - (4 * a * c)

    sol0 = (-b - cmath.sqrt(d)) / (2*a)
    sol1 = (-b + cmath.sqrt(d)) / (2*a)

    print("X could be", sol0, "or", sol1)