You are viewing our Forum Archives. To view or take place in current topics click here.
Python Programming Help please, appreciated
Posted:

Python Programming Help please, appreciatedPosted:

Awake
  • Resident Elite
Status: Offline
Joined: Sep 27, 201113Year Member
Posts: 211
Reputation Power: 9
Status: Offline
Joined: Sep 27, 201113Year Member
Posts: 211
Reputation Power: 9
need some help doing python, how could i explain this code step by step

while True:
alphabet = ["+","A","B","C","D","E","F","G","H","I","J","K",
"L","M","N","O","P","Q","R","S","T","U","V",
"W","X","Y","Z"]
word = input("what would you like to encrypt: ").upper()
encrypt = input("enter a word to encrypt by: ").upper()
length = (len(word))
string = " "
for x in range (length):
encryptx = x
while encryptx >= len(encrypt):
encryptx = encryptx - len(encrypt)
offset = alphabet.index(encrypt[encryptx])
letterw = word[x]
if letterw == " ":
string = string + " "
continue
digit = alphabet.index(letterw)
digit += offset
while digit > 25:
digit -= 26
while digit < 0:
digit += 26

string += alphabet[digit]

print(string)
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.