题解 | #字符串字符匹配#
合法IP
http://www.nowcoder.com/practice/995b8a548827494699dc38c3e2a54ee9
a=input().strip('.').split('.')
m=['01','02','03','04','05','06','07','08','09']
for k in range(4):
if len(a)!=4 or a[int(k)] in m :
print('NO')
exit()
else:
for j in a:
if j=='' or not j.isdigit():
print('NO')
exit()
for i in a:
i=int(i)
if len(str(bin(i)))<=10:
continue
else:
print('NO')
exit()
print('YES')