import sys def calculate_byte_size(string): return sys.getsizeof(string) my_string = "Hello, world!" byte_size = calculate_byte_size(my_string) print("Byte size of the string:", byte_size, "bytes")
import sys def calculate_byte_size(string): return sys.getsizeof(string) my_string = "Hello, world!" byte_size = calculate_byte_size(my_string) print("Byte size of the string:", byte_size, "bytes")