Length
Usage
• Length[expr] 给出expr中元素的个数。
Notes
• 参见 Mathematica 全书 : 节 1.4.8, 节 1.8.3 and 节 2.1.5.
• 只要 AtomQ[expr] 为 True, Length[expr] 返回 0。
Further Examples
This list has four elements.
In[1]:=
|
Out[1]=
|
This expression has length two.
In[2]:=
|
Out[2]=
|
In[3]:=
|
Out[3]//FullForm=
|
This gives the number of digits in 1000!.
In[4]:=
|
Out[4]=
|
|