I have a positive integer variable which can have values between 0 to 999. This integer is then passed to a software.
To pass into this software the integer should a
I don't know why the zeros got chopped off (ideally you should fix the source of the problem), but you can format the numbers as strings and then turn them back into ints:
numbers = [1, 19, 255]
numbers = [int('{:<03}'.format(number)) for number in numbers]
This left-aligns each number with <, in a field 3 characters wide, filling extra characters with 0.