Hi guys can anyone tell me whats wrong with my counter variable. I want it to go up by 1 each time the code inside the for loop is executed. Instead it just stays at 1 lol. Here is a link if you want to understand the purpose of the function Luhn algorithm - Wikipedia.
You’ve declared the counter inside the loop and set it to the value of 0. Therefore every time the loop cycles round, it sets counter to 0 and then increments it. You need to declare counter outside of the loop first, and then it should work correctly!
Literally just as you replied I figured it out myself haha. Cheers buddy