From 452be24a19edbc660ee308adcc58aead03706bb5 Mon Sep 17 00:00:00 2001 From: plane000 Date: Fri, 4 May 2018 17:53:55 +0100 Subject: [PATCH] Added some python projects --- Python/Brute Force Helo, World!.py | 12 ++++ Python/{countup => }/Countup.py | 0 Python/Login/players | Bin 86 -> 0 bytes Python/{Prime cracker => }/Prime cracker.py | 0 Python/Quadratics.py | 59 ++++++++++++++++++++ Python/{RPS => }/RPS-Ducky_Vinex-1_1.py | 0 Python/{IDK => }/asd.py | 0 Python/{Login => }/login_cod.py | 0 8 files changed, 71 insertions(+) create mode 100644 Python/Brute Force Helo, World!.py rename Python/{countup => }/Countup.py (100%) delete mode 100644 Python/Login/players rename Python/{Prime cracker => }/Prime cracker.py (100%) create mode 100644 Python/Quadratics.py rename Python/{RPS => }/RPS-Ducky_Vinex-1_1.py (100%) rename Python/{IDK => }/asd.py (100%) rename Python/{Login => }/login_cod.py (100%) diff --git a/Python/Brute Force Helo, World!.py b/Python/Brute Force Helo, World!.py new file mode 100644 index 0000000..aad71c1 --- /dev/null +++ b/Python/Brute Force Helo, World!.py @@ -0,0 +1,12 @@ +import random + +target = 'Hello World!' +testString = '' + +while testString != target: + testString = '' + for i in range(12): + testString += chr(random.randint(32, 126)) + print(testString) + +print(testString) diff --git a/Python/countup/Countup.py b/Python/Countup.py similarity index 100% rename from Python/countup/Countup.py rename to Python/Countup.py diff --git a/Python/Login/players b/Python/Login/players deleted file mode 100644 index c0aaca4aa502fdc65029c277c119ce97e0fc94e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 86 zcmZo*t}SGUU}j)oa7xW9WQ;9j(ufcP@(OYi^HPCCWpP2WLwasvW{zHRer_Ri1Rqec kBErKn#j(uQC*Q}=z_5_Tn?HgTDC}R7ky=#9np&&}0PblQTL1t6 diff --git a/Python/Prime cracker/Prime cracker.py b/Python/Prime cracker.py similarity index 100% rename from Python/Prime cracker/Prime cracker.py rename to Python/Prime cracker.py diff --git a/Python/Quadratics.py b/Python/Quadratics.py new file mode 100644 index 0000000..c88a908 --- /dev/null +++ b/Python/Quadratics.py @@ -0,0 +1,59 @@ +from cmath import sqrt + +a = '' +b = '' +c = '' + +success = False + +while success == False: + try: + a = float(input("a: ")) + success = True + except: + print("That is not a number") + +success = False + +while success == False: + try: + b = float(input("b: ")) + success = True + except: + print("That is not a number") + +success = False + +while success == False: + try: + c = float(input("c: ")) + success = True + except: + print("That is not a number") + +bn = -b +s1 = b ** 2 +s2 = 4 * a * c +discriminant = sqrt(s1 - s2) + +dinom = 2 * a + +if discriminant == 0: + neum = bn + discriminant + root = neum1 / dinom + root = root.real + + print("Root: ", root) +else: + neum1 = bn - discriminant + neum2 = bn + discriminant + + root1 = neum1 / dinom + root2 = neum2 / dinom + root1 = root1.real + root2 = root2.real + + print("Root 1: ", root1) + print("Root 2: ", root2) + + diff --git a/Python/RPS/RPS-Ducky_Vinex-1_1.py b/Python/RPS-Ducky_Vinex-1_1.py similarity index 100% rename from Python/RPS/RPS-Ducky_Vinex-1_1.py rename to Python/RPS-Ducky_Vinex-1_1.py diff --git a/Python/IDK/asd.py b/Python/asd.py similarity index 100% rename from Python/IDK/asd.py rename to Python/asd.py diff --git a/Python/Login/login_cod.py b/Python/login_cod.py similarity index 100% rename from Python/Login/login_cod.py rename to Python/login_cod.py