Strings are immutable, which means they cannot be changed once created. For example, you might think that the following code changes the value of my_string
into the string 'train'
, but this is not valid:
Example Code
my_string = 'brain'
my_string[0] = 't'
Confirm that by using the bracket notation to access the first letter in text
and try to change it into a character of your choice. You will see the ouput disappear and an error appear.
what do i have to do? in this step?
create string ‘hello world’?
The example code tries to change the first letter of my_string
to the letter t
using the bracket notation to access the first letter in text
and try to change it into a character of your choice.
Use the same format to try and change the first letter of the string text
1 Like
Please use the “Ask for help” button in the future.
If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.
The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.
Thank you.
1 Like
mind showing me how to do that?
Thanks for help!
can u write a soultion for me?
Thanks!
I still don’t get it.
1 Like
Nope, we don’t write the answers for people as that doesn’t really help you learn
Do you have a question? What is it that you don’t get exactly? Happy to explain.
that’s true too let me try to figure it out.