-2

I am learning the app Jar module so I decided to make an encoder but I keep getting this error and I don't get what it means. I have looked it up on here and it talks about indexes but I haven't got any I don't think. My code is below an I hope you can help. This is the error

  • 2
    Welcome to Stackoverflow! Please, noone is going to write code from screenshot - add code here, proper format it, etc. So everyone could understand what is the problem, how to reproduce it, and then it'll be possible to solve it. – kosist Mar 03 '19 at 21:07
  • Try to use while counter < numLetters , not while counter <= numLetters – Mahrez BenHamad Mar 03 '19 at 21:13

1 Answers1

0

Note that indexes in string in Python starts from 0 (index of the first symbol) and ends with len(string) - 1 (index of last symbol). In your code, you have counter <= numLetters, so you have error trying access symbol with counter index while the maximum index is counter - 1, use counter < numLetters instead.

ingvar
  • 4,169
  • 4
  • 16
  • 29