1. Home
  2. Data Science
  3. Python
  4. What is the difference between bytes and bytearray in…

Added 25 Nov 2026

What is the difference between bytes and bytearray in Python?

  1. bytes is immutable; bytearray is mutable Correct answer
  2. bytes is mutable
  3. They are identical
  4. bytearray stores only text

Correct answer

A. bytes is immutable; bytearray is mutable

6 views

MCQSEXAM

Explanation

bytearray supports in-place modification.

Reference

Asked in: Python Interview Standard Library

https://docs.python.org/3/library/index.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs