+ 1
Can i change a letter in a string in a list
word =['hello'] word [0][0] = 'H'
2 Answers
+ 1
The following code you gave above won't work.Strings can only be used to read and can't change its value when you see it in the form of touples .âș
But still you could change the value given the string by the slicing methord ,đ
like this ::
word=["hello"]
print ("H"+word[0][1:])
I hope you understand .....đđđđ€
+ 1
it worked! đ€Łi hope to learn more about the slicing method later in the lessons