SyntaxFix
Write A Post
Hire A Developer
Questions
You can do this with f strings.
import numpy as np print(f'{np.random.choice([1, 124, 13566]):0>8}')
This will print constant length of 8, and pad the rest with leading 0.
0
00000001 00000124 00013566