-1
Ceci est mon code. Je suis nouveau à la programmation, alors pouvez-vous m'aider à résoudre comment transposer correctement la ligne et la colonne?python - transposer une ligne et une colonne
def scytale_encrypt(plain_text, key):
chars = [c for c in plain_text if c not in (' ',',','.','?','!',':',';',"'")]
chunks = math.ceil(len(chars)/ float(key))
inters, i, j = [], 1, 1
cipher, k = [], 0
item=[]
while i <= chunks :
inters.append(tuple(chars[j-1:(j + key)-1]))
i += 1
j += key
while k < key:
l = 0
while l < chunks:
if k >= len(inters[l])and plain_text.islower():
cipher.append('z')
elif k >= len(inters[l]):
cipher.append('Z')
else:
cipher.append(inters[l][k])
l += 1
k += 1
print (inters)
return ''.join(cipher);
mon entrée My inpputed plain text and key
semble trop compliqué, postez votre 'plain_text' – RomanPerekhrest
J'ai fait télécharger une photo, veuillez jeter un oeil. J'ai édité mon post – JEFF