Hey guys! I'm with a little problem... This code works like this (it's in portuguese and I couldn't translate it --> I'm in a hurry!): you put a number and choose a digit. It'll return the number of times the digit appears in the number. In line 29 I'm getting the error of the title... What's wrong?
Now I realized that in line 27 I was comparing i with n, not the length of n O.o
Maybe this wasn't the problem, but I considered num and n as strings, did some slight changes and the code worked.
Obrigado mesmo assim (Thank you anyway) ^-^