Y
Y
YOKARAMANE2021-10-28 20:20:55
Python
YOKARAMANE, 2021-10-28 20:20:55

How to increase the allowed number of input characters?

/del /del /del /del /del /del /del /del /del /del /del /del

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
antares4045, 2021-10-28
@YOKARAMANE

Perhaps this is not the final solution, but from our communication in the comments, I made the assumption that the string you have is stored in the form
"abvgdeziyklmnoprostufhtschshshchyyeyuya" then
the essence of the problem:

position =alphabet.find('я') # 31
newPosition = position + key # 36
alphabet [newPosition] # ааааа! нет такой буквы

I assume that you wanted to play the Solomon cipher, in which, when you go over the edge, the count starts again
position =s.find('я') # 31
newPosition = (position + key) % len(alphabet) # 4
alphabet [newPosition] # д

By the way, do not forget that either the alphabet must contain both lowercase and uppercase letters, or before encryption, everything must be reduced to the register in which your dictionary is stored.
And because of what the cipher shift is wrong without a clue: throw off your alphabet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question