Home > other >  The IP address of the python binary converted to decimal
The IP address of the python binary converted to decimal

Time:10-12

Want to use ". "
segmentationHow the whole?
For a great god

CodePudding user response:

 
V2="11000000.10101000.01100000.01011110"
V2l=v2. The split (')
V10l=[]
For I in v2l:
V10l. Append (STR (int (I, base=2)))
V10=". ". The join (v10l)
Print (v10)

CodePudding user response:

reference 1st floor Jaryy response:
 
V2="11000000.10101000.01100000.01011110"
V2l=v2. The split (')
V10l=[]
For I in v2l:
V10l. Append (STR (int (I, base=2)))
V10=". ". The join (v10l)
Print (v10)

It is no point in a binary number, the point to insert, steps, and I thought for an afternoon in the library, don't want to come out, please

CodePudding user response:

Int (" 101010 ", 2)

CodePudding user response:

refer to the second floor qq_45851425 response:
Quote: refer to 1st floor Jaryy response:
 
V2="11000000.10101000.01100000.01011110"
V2l=v2. The split (')
V10l=[]
For I in v2l:
V10l. Append (STR (int (I, base=2)))
V10=". ". The join (v10l)
Print (v10)

It is no point in a binary number, the point to insert, steps, and I thought for an afternoon in the library, don't want to come out, come on


There is no point that according to the eight to cough up

 import re 
V2="11000000101010000110000001011110"
V2l=re. The.findall (' {8} ', v2)
V10l=[]
For I in v2l:
V10l. Append (STR (int (I, base=2)))
V10=". ". The join (v10l)
Print (v10)
  • Related