mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-10 00:36:48 +02:00
String length by @thesourabh
This commit is contained in:
@@ -126,6 +126,9 @@ not False # => True
|
|||||||
# 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'
|
"This is a string"[0] # => 'T'
|
||||||
|
|
||||||
|
# You can find the length of a string
|
||||||
|
len("This is a string") # => 16
|
||||||
|
|
||||||
#String formatting with %
|
#String formatting with %
|
||||||
#Even though the % string operator will be deprecated on Python 3.1 and removed
|
#Even though the % string operator will be deprecated on Python 3.1 and removed
|
||||||
#later at some time, it may still be good to know how it works.
|
#later at some time, it may still be good to know how it works.
|
||||||
|
Reference in New Issue
Block a user