plaintext:sunny day
key:like
sunny day
likelikel <--What I want to get
1)I would like to receive the plain text and key through input value to implement the classic cipher now. Compared to the plain text, I would like to make the key value repeat as long as the plain text as above.
for t in range(len(plaintext)):
letterspace = ord(plain[t]) - ord(keyletter[t])
2)Afterwards, we will work to find the distance between 's' and 'l', 'u' and 'i'..(continue) However, there is also a problem with this task. This makes indexerror: string index out of range error.
I want to know how to deal with these related two problems. It seems that the answer 1 and 2 are connected, so I post them together.