Please help as I am getting this unexpected error and I cant understand it.
According to the spec, the key should only be advanced when it is used. Considering that, when you print a special character (non-alphabetical), as well as making sure that it is printed unchanged, the key should not be advanced.
This is how it should be:
INPUT: world, say hello! KEY: bazba zba zbazb OUTPUT: xoqmd, rby gflkp!
And this is what your code is doing:
INPUT: world, say hello! KEY: bazbazbazbazbazba OUTPUT: xoqmd, szz gflkp!