1.

Do you modify a string in Python?

Answer»

If you want to modify the string, a new string value can be assign to the existing string variable. To define a new string value to the existing string variable. Python completely overwrite new string on the existing string.

Example:

>>> str1= ”How are you”

>>> print (str1)

How are you

>>> str1= ”How about you”

>>> print (str1)

How about you



Discussion

No Comment Found