all valid python 3 · zinating/algorithms-python@ea2ddaa · GitHub
Skip to content

Commit ea2ddaa

Browse files
committed
all valid python 3
1 parent b566055 commit ea2ddaa

37 files changed

Lines changed: 76 additions & 1436 deletions

boolean_algebra/quine_mc_cluskey.py

Lines changed: 3 additions & 3 deletions

ciphers/affine_cipher.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
SYMBOLS = """ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"""
55

66
def main():
7-
message = raw_input('Enter message: ')
8-
key = int(raw_input('Enter key [2000 - 9000]: '))
9-
mode = raw_input('Encrypt/Decrypt [E/D]: ')
7+
message = input('Enter message: ')
8+
key = int(input('Enter key [2000 - 9000]: '))
9+
mode = input('Encrypt/Decrypt [E/D]: ')
1010

1111
if mode.lower().startswith('e'):
1212
mode = 'encrypt'

ciphers/brute_force_caesar_cipher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def decrypt(message):
4444
print("Decryption using Key #%s: %s" % (key, translated))
4545

4646
def main():
47-
message = raw_input("Encrypted message: ")
47+
message = input("Encrypted message: ")
4848
message = message.upper()
4949
decrypt(message)
5050

ciphers/caesar_cipher.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,25 @@ def main():
4040
print("3.BruteForce")
4141
print("4.Quit")
4242
while True:
43-
choice = raw_input("What would you like to do?: ")
43+
choice = input("What would you like to do?: ")
4444
if choice not in ['1', '2', '3', '4']:
4545
print ("Invalid choice")
4646
elif choice == '1':
47-
strng = raw_input("Please enter the string to be ecrypted: ")
47+
strng = input("Please enter the string to be ecrypted: ")
4848
while True:
4949
key = int(input("Please enter off-set between 1-94: "))
5050
if key in range(1, 95):
5151
print (encrypt(strng, key))
5252
main()
5353
elif choice == '2':
54-
strng = raw_input("Please enter the string to be decrypted: ")
54+
strng = input("Please enter the string to be decrypted: ")
5555
while True:
5656
key = raw_int(input("Please enter off-set between 1-94: "))
5757
if key > 0 and key <= 94:
5858
print(decrypt(strng, key))
5959
main()
6060
elif choice == '3':
61-
strng = raw_input("Please enter the string to be decrypted: ")
61+
strng = input("Please enter the string to be decrypted: ")
6262
brute_force(strng)
6363
main()
6464
elif choice == '4':

ciphers/rsa_cipher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
def main():
88
filename = 'encrypted_file.txt'
9-
response = raw_input('Encrypte\Decrypt [e\d]: ')
9+
response = input('Encrypte\Decrypt [e\d]: ')
1010

1111
if response.lower().startswith('e'):
1212
mode = 'encrypt'

ciphers/simple_substitution_cipher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
55

66
def main():
7-
message = raw_input('Enter message: ')
7+
message = input('Enter message: ')
88
key = 'LFWOAYUISVKMNXPBDCRJTQEGHZ'
9-
resp = raw_input('Encrypt/Decrypt [e/d]: ')
9+
resp = input('Encrypt/Decrypt [e/d]: ')
1010

1111
checkValidKey(key)
1212

ciphers/transposition_cipher.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import math
33

44
def main():
5-
message = raw_input('Enter message: ')
6-
key = int(raw_input('Enter key [2-%s]: ' % (len(message) - 1)))
7-
mode = raw_input('Encryption/Decryption [e/d]: ')
5+
message = input('Enter message: ')
6+
key = int(input('Enter key [2-%s]: ' % (len(message) - 1)))
7+
mode = input('Encryption/Decryption [e/d]: ')
88

99
if mode.lower().startswith('e'):
1010
text = encryptMessage(key, message)

ciphers/transposition_cipher_encrypt_decrypt_file.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
def main():
66
inputFile = 'Prehistoric Men.txt'
77
outputFile = 'Output.txt'
8-
key = int(raw_input('Enter key: '))
9-
mode = raw_input('Encrypt/Decrypt [e/d]: ')
8+
key = int(input('Enter key: '))
9+
mode = input('Encrypt/Decrypt [e/d]: ')
1010

1111
if not os.path.exists(inputFile):
1212
print('File %s does not exist. Quitting...' % inputFile)
1313
sys.exit()
1414
if os.path.exists(outputFile):
1515
print('Overwrite %s? [y/n]' % outputFile)
16-
response = raw_input('> ')
16+
response = input('> ')
1717
if not response.lower().startswith('y'):
1818
sys.exit()
1919

ciphers/vigenere_cipher.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
33

44
def main():
5-
message = raw_input('Enter message: ')
6-
key = raw_input('Enter key [alphanumeric]: ')
7-
mode = raw_input('Encrypt/Decrypt [e/d]: ')
5+
message = input('Enter message: ')
6+
key = input('Enter key [alphanumeric]: ')
7+
mode = input('Encrypt/Decrypt [e/d]: ')
88

99
if mode.lower().startswith('e'):
1010
mode = 'encrypt'

data_structures/graph/bellman_ford.py

Lines changed: 6 additions & 6 deletions

0 commit comments

Comments
 (0)