About Lesson
Strings are Immutable:-
स्ट्रिंग immutable है इसका अर्थ यह है कि स्ट्रिंग वैरिएबल के कंटेंट को create करने के बाद उसको change नहीं किया जा सकता है।
a=”apple”
a[0]=’c’
print(a) #TypeError:
Note:- निम्न तरीके का उपयोग करके character को change कर सकते हैं-
a=”apple”
b=’c’+a[1:]
print(b) # cpple
Strings are Immutable:-
String is immutable, which means that the content of the string variable cannot be changed after it is created.
a=”apple”
a[0]=’c’
print(a) #TypeError:
Note:- You can change the character by using the following method-
a=”apple”
b=’c’+a[1:]
print(b) # cpple