Home > Backend Development > Python Tutorial > Some commonly used operators and built-in functions in python

Some commonly used operators and built-in functions in python

Release: 2020-06-15 17:25:17
forward
2743 people have browsed it

Some commonly used operators and built-in functions in python

1. Operator

Operator Instance Result Description Supported data types
[1,2] [3,4] [1 ,2,3,4] Merge Strings, lists, tuples
* ['A' ]*4 ['A','A','A','A'] Copy String, list, tuple
in 3 in (1,2,3) True Whether the element exists String, list , tuple, dictionary (to determine whether the key exists)
not in 3 not in (1,2,3) false Whether the element does not exist String, list, tuple, dictionary (to determine whether the key does not exist)

2. Built-in function

Function Description
cmp(item1,item2) Compare two values (When comparing dictionaries, compare keys first and then values)
len(item) Calculate the number of container elements
max(item) Returns the maximum value of the container
min(item) Returns the minimum value of the container
del(item) Delete variables

For more related knowledge, please pay attention to python video tutorial column

The above is the detailed content of Some commonly used operators and built-in functions in python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
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