employer cover photo
employer logo
employer logo

Brane Enterprises (nslhub)

Questa è la tua azienda?

Domanda di colloquio di Brane Enterprises (nslhub)

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

Risposta di colloquio

Anonimo

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.