Here is my module:
char_dict = ["a","A","b","B","c","C","d","D","e","E","f","F","g","G","h","H","i","I","j","J","k","K","l","L","m","M","n","N","o","O","p","P","q","Q","r","R","s","S","t","T","u","U","v","V","w","W","x","X","y","Y","z","Z","?","!",".",",","_"," "]
def encrypt(message,key):
end_msg = ""
through = 0
for char in message:
end_msg = end_msg + char_dict[char_dict.index(char) + key]
through = through + 1
return end_msg
Here is the file that uses the module:
import complexx
print(complexx.encrypt("zebra",15))
My problem is that when I use the key to offset the character to a new one by adding the index, and getting the resulting index and using it's string from the list, if you go too far (like demonstrated in the example code, you can try it out) it will say "string index out of range" because I am using a key that hops too many spaces ahead, and ends up going out of bounds (or indexes) of the list. I need