0

What's wrong

jeeva = "jee" jeeva[0] = k print(jeeva)

18th Mar 2020, 2:04 PM
Bai Jilla
Bai Jilla - avatar
2 odpowiedzi
+ 1
Probably you should do- jeeva = "jee" print(jeeva.replace('j','k')) // It will give 'kee'. Mistakes- 1) jeeva is a string object and is not an array in itself. 2) k is not defined. Things to remember- String objects are immutable and any alteration would lead to a creation of a new object.
18th Mar 2020, 2:31 PM
Avinesh
Avinesh - avatar
0
you're replacing the first character in jeeva with k which is j
18th Mar 2020, 2:10 PM
✳AsterisK✳
✳AsterisK✳ - avatar