Yup, there you have it, glad it works :)
It would be better practice though to use different name for your new variable, instead of num2, which is already your input value and index in xrange.
It would be better practice though to use different name for your new variable, instead of num2, which is already your input value and index in xrange.