hey first, why are you using two loops?
i think just one would be okay to iterate through it.
this challenge requires you to basically replace a character for another character 13 characters ahead, so you need a way to check this characters and then replace them with characters 13 places ahead.
use of an array would be great at this point and much easier.
You could have alpha as an array of alphabets and then str being an input, you can then iterate through the str check the alphabet and then check the index of the same alphabet in the alpha array and return the alphabet in that index +13, or conversely you can have alpha as an object where an the key-value pairs are an alphabet: alphabet 13 characters ahead. After checking you can push them to the results