x = '192.168.1.1'
y = '255.255.255.0'
a = x.split('.')
b = y.split('.')
a[0] & b[0]
トレースバック (最新の呼び出しが最後):
File "<pyshell#35>", line 1, in <module>
a[0] & b[0]
TypeError: unsupported operand type(s) for &: 'str' and 'str'
助けてください。192 から 255 の間、168 から 255 の間の and-ing プロセスの結果が欲しいのですが、どうすればよいですか?