hello,i need help. Can i get a clear and brief explanation with this question ? “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.”
thank you!
Hi there. For this particular challenge, you want to set the first letter in the variable text
to a different symbol. Bracket notation simply means you are accessing the variable like an array.
Here’s an example of what is meant:
my_string = 'brain'
my_string[0] = 't'
In this example, we have a variable called my_string
that holds the text “brain”. In the next line the first letter of the variable my_string
is accessed using bracket notation. The first letter always being stored at position 0
. The first letter of my_string
was then set to t
so that my_string
is now set as train
.
Hope this helps.
thank you but how come did they put the letter t when the variable my_string was define as brain? why not the letter b? (pls make it simple thx)
Because it is a different letter than what was already present.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.