18 lines
454 B
Python
18 lines
454 B
Python
def convert_bytes_format_127_to_256(numbers: list[int]):
|
|
new_list = []
|
|
for num in numbers:
|
|
if num > 0:
|
|
new_list.append(num)
|
|
else:
|
|
new_list.append(num + 256)
|
|
return new_list
|
|
|
|
|
|
def convert_bytes_format_256_to_127(numbers: list[int]):
|
|
new_list = []
|
|
for num in numbers:
|
|
if num < 128:
|
|
new_list.append(num)
|
|
else:
|
|
new_list.append(num - 256)
|
|
return new_list
|