import struct
def is_bitmap(file):
with open(file, 'rb') as s:
*type_of_file, size, _, _, _, width, height, _, color = struct.unpack('<ccIIIIIIHH', s.read(30))
if type_of_file == [b'B', b'M']:
print('The size of the picture is {}, and of color {}.'.format(size, color))
else:
print('This is not a bitmap')
31nm