Python-Ref > Data structures > Sequence types in general > Sequence length
 
 

^^->
Klíčová slova
Moduly
Knihovní funkce

Sequence length

How to measure the length of a sequence
For the task at hand, there is the built-in function len.
Expand/Shrink
Zdroj: (sequence0-1.py)
  1   xs = [0,1,2,3,10,-5]
  2   string = "Night Watch"
  3   
  4   print len( xs)
  5   print len( string)
stdout:
6
11
Doba běhu: 21.4 ms