There is a task at the entrance to the script Hex code ( "7200F40004226301" ). This code into a variable is read in the list format, and each character has an extension like str, and it is necessary that the script could work with the symbol as with a number.
for item in content: for symbol in item: k = int(''.join("%02X " % ord( symbol ))) result:
>> symbol 7 >>> type(symbol) <class 'str'> >>> type(k) <class 'int'> >>> k 37 >>> hex(k) '0x25' But I want to make hex(k) = 0x07 , not 0x25 . Perhaps I initially chose the wrong way to solve the problem, since I am a layman in programming.
0x. - mkkikprint(ascii(ваша_строка)). What do you want to get as a result (type, value)? Explicitly an example of input output using Python syntax show. - jfs