-1
これは私のコードです。私はプログラミングに慣れていないので、行と列を正しく転置する方法を解決する手助けはできますか?python - 行と列の転記
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);
ここに私の入力 My inpputed plain text and key
あなたの 'plain_text'を投稿してください – RomanPerekhrest
私は親切に写真をアップロードしました。私は自分の投稿を編集した – JEFF