Към основното съдържание
🔒 Режим за преглед. Първите петнадесет урока на Foundations са безплатни; този е Pro. Стартирайте 7-дневен trial, за да отключите редактора, AI подсказките и останалата част от курса. Изисква се карта, отменете по всяко време в Dashboard.Стартирай 7-дневен trial →
← КурсовеSenior Deep-DivesModule 1 · Concurrency internals · RecapИзгледи на паметта и буферен протоколpredict32 / 161
+100 XP
Задача🌐 shown in EN
📝 **Question:** Predict the exact output. \`mv = memoryview(data)\` is a zero-copy WINDOW into the bytearray. Then \`slice_view = mv[0:5]\` is a smaller window into the SAME buffer. The question: does writing through \`slice_view\` change \`data\`? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
Предскажи изхода

Прочети кода внимателно

data = bytearray(b"hello world")
mv = memoryview(data)
print(f"original:{data.decode()}")

mv[6:11] = b"PYTHN"
print(f"after_view_write:{data.decode()}")

slice_view = mv[0:5]
print(f"slice:{bytes(slice_view).decode()}")

slice_view[0] = ord("H")
print(f"data_now:{data.decode()}")
print(f"mv_view:{bytes(mv).decode()}")

Какво ще изведе програмата? Напиши тук: