In Python versions 2.6 or earlier, you need to explicitly number the format fields:
':'.join("{0:x}\n".format(random.randint(0, 2**16 - 1)) for i in range(4))
# ^
You can read about this in the docs:
Changed in version 2.7: The positional argument specifiers can be omitted, so
'{} {}'
is equivalent to'{0} {1}'
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With