MWZ

MINDWAREZONE

beginnerPython

Which Python data types are immutable?

Answer

Clear, interview-ready explanation

Common immutable Python data types include:

  • int
  • float
  • complex
  • bool
  • str
  • tuple
  • range
  • bytes
  • frozenset
  • NoneType

Example:

number = 10
number = number + 5

print(number)

// Output
15
            

  The original integer object is not modified. Instead, a new integer value is created, and number is reassigned to it.