Post

@Python_Dv Option C : Error😉
Why??👇
This gives an error because strings in Python are immutable.
Immutable means you cannot change individual characters of a string after it is created.
So this is not allowed:
a[0] = "p" ❌
English

@Python_Dv Output C) error
Strings are immutable in Python so you can't change characters by index. If you want to capitalize it, you'd need to reassign it using a method: a = a.capitalize().
English

Analysis
Immutability: Strings in Python are immutable, meaning you cannot change an individual character in place after the string is created.
The Operation: a[0] = "P" attempts to modify the first character of the string.
Result: This will raise a TypeError: 'str' object does not support item assignment.
Answer: C) error.
English

@Python_Dv Error because string replacement we use replace.the following method is used for list
English

@Python_Dv Error is right answer.
String is immutable so we can't perform any changes in string,
If you still want to print Python then you use method . captilize()
and get the result as Python.
English

























