I have a requirement to add 2 string which are in mac format as hex which has 9 octets. As part of that I have achieved almost, but one final thing pending is to get the value in 2 digit format.
string1= "aa.aa.aa.aa.aa.aa.aa.aa.ff"
string2= "00.00.00.00.00.00.00.00.01"
when I add these 2 the out put I get is aa.aa.aa.aa.aa.aa.aa.ab.0
but I want value to be aa.aa.aa.aa.aa.aa.aa.ab.00
. (2 zeros).
I tried using
temp = '%02d' % string3
but I got error
TypeError: %d format: a number is required, not str
as I am trying to do that with string.