Thank you all for your replies, I think I get it now - I thought that when you called a function from within itself that it would essentially be looping around... but I guess it's essentially starting a 'new' function, so the value of the variable 'answer' in the original function would stay unchanged.
stullis - that's quite similar to how I re-wrote it in the end, although you've managed to do it in a few less steps than me :)
I'm starting to really appreciate how complex coding can be... even the simplest little task can be written in hundreds of different ways! :/
stullis - that's quite similar to how I re-wrote it in the end, although you've managed to do it in a few less steps than me :)
I'm starting to really appreciate how complex coding can be... even the simplest little task can be written in hundreds of different ways! :/