Usage of len() in python

angryTom
Release: 2019-07-22 13:39:31
Original
34874 people have browsed it

Usage of len() in python

Recommended tutorial: Python tutorial

Function: len ()

#Return the length of string, list, dictionary, tuple, etc.

Syntax: len(str)

str: ​​String, list, dictionary, tuple, etc. to be calculated

Return value : The length of elements such as strings, lists, dictionaries, and tuples.

Test:

1: Calculate the length of the string

Usage of len() in python

2: Calculate the length of the array

Usage of len() in python

3: Calculate the length of the dictionary

Usage of len() in python

The above is the detailed content of Usage of len() in python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template