@Mosrod/

QuadraticSolverPlus

Python

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.3031920749043888","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"IyBDcmVhdGVkIEJ5IE1vc3JvZCAoTmF0aGFuIFIpCiMgKEMpIDIwMTggTmF0aGFuIFIsIFtBTEwgUklHSFRTIFJFU0VSVkVEXQoKYSA9IGZsb2F0KGlucHV0KCJhOiAiKSkKYiA9IGZsb2F0KGlucHV0KCJiOiAiKSkKYyA9IGZsb2F0KGlucHV0KCJjOiAiKSkKCmJuZWdhdGl2ZSA9IGIgKiAtMQpic3F1YXJlZCA9IHJvdW5kKGIgKiogMiwgMTApCmZvdXJhYyA9IGEgKiBjCmZvdXJhYyA9IGZvdXJhYyAqIDQKdHdvYSA9IGEgKiAyCnNxcnQgPSBic3F1YXJlZCAtIGZvdXJhYwpzcXJ0Y2FsYyA9IHNxcnQgKiogKDEgLyAyKQpzb2x1dDEgPSBibmVnYXRpdmUgKyBzcXJ0Y2FsYwpzb2x1dDFkb25lID0gc29sdXQxIC8gdHdvYQppZiBzcXJ0IDwgMDoKICAgIHByaW50KCdObyBSZWFsIFNvbHV0aW9ucyEnKQogICAgcmVhbHNvbHV0aW9ucyA9ICdGYWxzZScKZWxzZToKICAgIHJlYWxzb2x1dGlvbnMgPSAnVHJ1ZScKcHJpbnQoIlNvbHV0aW9uIDE6Iiwgc29sdXQxZG9uZSkKc29sdXQyID0gYm5lZ2F0aXZlIC0gc3FydGNhbGMKc29sdXQyZG9uZSA9IHNvbHV0MiAvIHR3b2EKcHJpbnQoIlNvbHV0aW9uIDI6Iiwgc29sdXQyZG9uZSkKCnByaW50KCIiIgogIFNURVAgMTogCiAgezB9wrHiiJp7MX0tNCh7Mn0pKHszfSkKICAtLS0tLS0tLS0tLS0tLS0tLS0tLQogIHs0fQogICIiIi5mb3JtYXQoYm5lZ2F0aXZlLCBic3F1YXJlZCwgYSw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4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Created By Mosrod (Nathan R)
# (C) 2018 Nathan R, [ALL RIGHTS RESERVED]

a = float(input("a: "))
b = float(input("b: "))
c = float(input("c: "))

bnegative = b * -1
bsquared = round(b ** 2, 10)
fourac = a * c
fourac = fourac * 4
twoa = a * 2
sqrt = bsquared - fourac
sqrtcalc = sqrt ** (1 / 2)
solut1 = bnegative + sqrtcalc
solut1done = solut1 / twoa
if sqrt < 0:
    print('No Real Solutions!')
    realsolutions = 'False'
else:
    realsolutions = 'True'
print("Solution 1:", solut1done)
solut2 = bnegative - sqrtcalc
solut2done = solut2 / twoa
print("Solution 2:", solut2done)

print("""
  STEP 1: 
  {0}±√{1}-4({2})({3})
  --------------------
  {4}
  """.format(bnegative, bsquared, a, c, twoa))

fourac = abs(fourac)

if (a < 0) and (c < 0):
    sign = '-'

elif (a < 0) or (c < 0):
    sign = '+'

else:
    sign = '-'

print("""

  STEP 2:
  {0}±√{1}{2}{3}
  --------------------
  {4}

  """.format(bnegative, bsquared, sign, fourac, twoa))

print("""

  STEP 3:
  {0}±√{1}
  --------------------
  {2}

  """.format(bnegative, sqrt, twoa))

print("""

  STEP 4:
  {0}±{1}
  --------------------
  {2}
  REAL SOLUTIONS:
  
  {3}

  """.format(bnegative, sqrtcalc, twoa, realsolutions))

print("""

  STEP 5:
  {0}
  --------------------
  {1}

  {2}
  --------------------
  {1}
  
  REAL SOLUTIONS:
  {3}

  """.format(solut1, twoa, solut2, realsolutions))

print("""

  STEP 6:
  {0}

  {1}

  REAL SOLUTIONS:
  {2}
  """.format(solut1done, solut2done, realsolutions))