【python】python中len()怎么用
1、len函数的作用,是Return the number of items in a container.,翻译过来,就是返回容器中项目的数目。

3、容器可以是列表:a=[]print(len(a))

5、容器可以是字符串:

7、反斜杠组合而成的转移符,只是一个字符:a='\n\t'print(len(a拘七呷憎))这里要特别注意,\n是一个字符。

1、len函数的作用,是Return the number of items in a container.,翻译过来,就是返回容器中项目的数目。
3、容器可以是列表:a=[]print(len(a))
5、容器可以是字符串:
7、反斜杠组合而成的转移符,只是一个字符:a='\n\t'print(len(a拘七呷憎))这里要特别注意,\n是一个字符。