employer cover photo
employer logo
employer logo

Brane Enterprises (nslhub)

Est-ce votre entreprise ?

Question d’entretien chez Brane Enterprises (nslhub)

Why in python string is immutable but in cpp it is mutable?

Réponse à la question d'entretien

Utilisateur anonyme

25 nov. 2023

I said since in cpp a string is array of chars we can iterate it and mutate its value but unlike cpp in python a string is immutable as it is refferenced from the memory as an object so directly we can not mutate a string in python but we can convert it to a list of chars and then we can mutate it.