mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-05 22:37:42 +02:00
Merge pull request #3951 from kuvam/patch-1
[python/en] Change string access example for clarity
This commit is contained in:
@@ -132,7 +132,7 @@ b == a # => True, a's and b's objects are equal
|
|||||||
"Hello " "world!" # => "Hello world!"
|
"Hello " "world!" # => "Hello world!"
|
||||||
|
|
||||||
# A string can be treated like a list of characters
|
# A string can be treated like a list of characters
|
||||||
"This is a string"[0] # => 'T'
|
"Hello world!"[0] # => 'H'
|
||||||
|
|
||||||
# You can find the length of a string
|
# You can find the length of a string
|
||||||
len("This is a string") # => 16
|
len("This is a string") # => 16
|
||||||
|
Reference in New Issue
Block a user