Home Backend Development Python Tutorial Introduction to common operations on lists in Python

Introduction to common operations on lists in Python

Mar 22, 2017 am 11:16 AM

Mainly involving knowledge points

The list is the most common data type in our python. We mainly have the following operations.

1, Index

2, Slice

3, Append

4, Delete

5, Length

6, Loop (also called traversal)

7, Contains

8, Nested

For example Definition list:

List2=['openstack','python','linux',"docker","zabbix","nginx","linux","linux","123","ww33##"]
或者
List2=list(['openstack','python','linux',"docker","zabbix","nginx","linux","linux","123","ww33##"])
Copy after login

Mainly involved basic methods and introduction

Introduction to common operations on lists in Python

Simple example:

1. Definition of list

 >>> List2=list(['openstack','python','linux',"docker","zabbix","nginx","linux","
linux","123","ww33##"])
>>> print(List2)
['openstack', 'python', 'linux', 'docker', 'zabbix', 'nginx', 'linux', 'linux',
'123', 'ww33##']
或者List2=['openstack','python','linux',"docker","zabbix","nginx","linux","
linux","123","ww33##"] 我们直接用后面的这种定义,检验和模拟相关方法和切片等。
Copy after login

2. Slicing and List Value

Slicing is mainly a method to obtain part or a single element in the list. The elements in the list are accessed through subscripts, and the subscripts start counting from 0

Get a value in the list (get the value through the subscript, the subscript starts from 0)

List2=['openstack','python','linux',"docker","zabbix","nginx","linux","linux","123","ww33##"]
print(List2[0])
print(List2[1])
print(List2[-2])
结果:
openstack
python
123
 
    我们发现在取值时下标为零的恰好取的值为是第一位元素,更好的证明了下标从零开始这一说法,
 同时发现print(List2[-2])恰好是倒数第二位元素,由此可见不仅顺着取值,可以倒着取值。
Copy after login
切片:访问里面的前多个值:
List2=['openstack','python','linux',"docker","zabbix","nginx","linux","linux","123","ww33##"]
 
print(List2[0:3]) #取前三个
 
结果:
['openstack', 'python', 'linux']
再试试
print(List2[:3])
结果:
['openstack', 'python', 'linux']
由此我们可以看出开始下标是0的时候,可以省略不写,还需要注意下标[0:3]能取到1,2,3位的元素,
即表示第四位取不到,在我们边界取值时需要注意。
print(List2[3:-1]) #取不到最后一位
print(List2[3:])  #取得第四位到最后一位
print(List2[2:9:2])#取出下标为第二位到下标为9之间的 每隔一个元素取一次
print(List2[-3:-1]) #倒着取值取出倒数第三位和倒数第二位
print(List2[-3:])#取出倒数的后三位
print(List[0::2])#每隔一个元素取一次
print(list[::2]) #每隔一个元素取一次 和上面的一样
结果:
['docker', 'zabbix', 'nginx', 'linux', 'linux', '123']
['docker', 'zabbix', 'nginx', 'linux', 'linux', '123', 'ww33##']
['linux', 'zabbix', 'linux', '123']
['linux', '123']
['linux', '123', 'ww33##']
Copy after login

3. Add elements to the list

Mainly use the append method to append elements , add

List2.append("winner")
print(List2)
结果:
['openstack', 'python', 'linux', 'docker', 'zabbix', 'nginx', 'linux', 'linux', '123', 'ww33##', 'winner']
Copy after login

at the end to insert an element at a certain position, you can use the insert method to achieve

List2.insert(2,"baidu") #在第三位插入元素baidu
print(List2)
结果:
['openstack', 'python', 'baidu', 'linux', 'docker', 'zabbix', 'nginx','123', 'ww33##']
由此看出在某位置插入时,该位置元素整体向后移动。
Copy after login

4. Modify the value of an element

Modify the value of an element, This is generally achieved through reassignment.

List2[2]="我的钢铁"
List2[-1]="人生苦短,我用python!"
#List2.insert(2,"baidu")
print(List2)
['openstack', 'python', '我的钢铁', 'docker', 'zabbix', 'nginx', '123', '人生苦短,我用python!']
Copy after login

5. Delete

Deletion is divided into deleting one and deleting all. When deleting individual items, we can use the remove() method and pop() method, and use del and The clear() method can delete the entire list. Next, we will analyze the differences between the several methods based on examples.

The parameter in the middle of the pop() method is the subscript. When there is no parameter, the last digit is deleted by default.

List2.pop(1)
print(List2)
结果
['openstack', 'linux', 'docker', 'zabbix', 'nginx', '123', 'ww33##']
List2.pop(-4)
print(List2)
结果:
['openstack', 'python', 'linux', 'docker', 'nginx', '123', 'ww33##']
Copy after login

The parameter in the remove() method is directly the content of the element

List2.remove('linux')
print(List2)
结果:
['openstack', 'python', 'docker', 'zabbix', 'nginx', '123', 'ww33##']
当列表存在相同元素linux时:
List2=['openstack','linux','python','linux',"docker","zabbix","nginx","123",'linux',"ww33##"]
List2.remove('linux')
print(List2)
结果:
['openstack', 'python', 'linux', 'docker', 'zabbix', 'nginx', '123', 'linux', 'ww33##']
当存在多个值时只会删除一个值
Copy after login

clear() method is used to process the entire list

List2.clear()
print(List2)
结果:
[]
Copy after login

del can delete the entire list Or a single element

del  List2
print(List2)
del  List[2]
结果:
Traceback (most recent call last):
  File "C:/Users/Administrator/PycharmProjects/s14/jiounumber.py", line 21, in <module>
    print(List2)
NameError: name &#39;List2&#39; is not defined
删除个别元素 结合切片
List2=[&#39;openstack&#39;,&#39;云计算&#39;,&#39;python&#39;,"中国","中东",&#39;linux&#39;,123,"ww33##"]
del List2[2]
print(List2)
结果:
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;中国&#39;, &#39;中东&#39;, &#39;linux&#39;, 123, &#39;ww33##&#39;]
Copy after login

Observing the results, you can find that del deletes the defined list and clear() empties the elements of the list.

6. Query the position of an element and the number of occurrences (list elements can be repeated)

Querying the list mainly includes statistics on the length of the list and querying the elements of a certain content At what position, it is mainly implemented using the index() index method and the count() element occurrence method.

List2=[&#39;openstack&#39;,&#39;python&#39;,&#39;linux&#39;,"docker","zabbix","nginx","123","ww33##"]
索引:
print(List2.index("linux"))
结果
2
 
统计:
print(List2.count("linux"))
结果
1
 
List2=[&#39;openstack&#39;,&#39;linux&#39;,&#39;python&#39;,&#39;linux&#39;,"docker","zabbix",&#39;linux&#39;,"nginx","123","ww33##"]
print(List2.index("linux"))
print(List2.count("linux"))
结果:
1
3
Copy after login

It can be seen that when an element contains multiple elements with the same shape, the index usually finds the first element.

7. Flip and sort the list

You can flip and sort the list through the reverse() method and sort() method. The so-called flipping is to flip the list The position of the elements is flipped again, and the sorting is mainly based on the Ascall code.

List2=[&#39;openstack&#39;,&#39;linux&#39;,&#39;python&#39;,&#39;linux&#39;,"docker","zabbix",&#39;linux&#39;,"nginx","123","ww33##"]
List2.reverse()
print(List2)
结果:
[&#39;ww33##&#39;, &#39;123&#39;, &#39;nginx&#39;, &#39;linux&#39;, &#39;zabbix&#39;, &#39;docker&#39;, &#39;linux&#39;, &#39;python&#39;, &#39;linux&#39;, &#39;openstack&#39;]
 
排序:
List2.sort()
print(List2)
[&#39;123&#39;, &#39;docker&#39;, &#39;linux&#39;, &#39;linux&#39;, &#39;linux&#39;, &#39;nginx&#39;, &#39;openstack&#39;, &#39;python&#39;, &#39;ww33##&#39;, &#39;zabbix&#39;]
再稍微复杂一点,里面添加中文和整数等内容
List2=[&#39;openstack&#39;,&#39;云计算&#39;,&#39;python&#39;,123,"docker","zabbix",&#39;linux&#39;,30.84,"123","ww33##"]
List2.sort()
print(List2)
执行结果:
Traceback (most recent call last):
  File "C:/Users/Administrator/PycharmProjects/s14/jiounumber.py", line 24, in <module>
    List2.sort()
TypeError: unorderable types: int() < str()
整型和字符串无法比较,接下来,再试试
List2=[&#39;openstack&#39;,&#39;云计算&#39;,&#39;python&#39;,"中国","中东",&#39;linux&#39;,"123","ww33##"]
List2.sort()
print(List2)
[&#39;123&#39;, &#39;linux&#39;, &#39;openstack&#39;, &#39;python&#39;, &#39;ww33##&#39;, &#39;中东&#39;, &#39;中国&#39;, &#39;云计算&#39;]
Copy after login

From this, we find that the sorting of the list is still very NB. Regarding the above integers and strings that cannot be compared, we can use the integer Convert to String comparison.

8. Looping, inclusion and copy(), extend() methods

Looping, usually by for loop, the list will be The method of printing out elements

List2=[&#39;openstack&#39;,&#39;云计算&#39;,&#39;python&#39;,"中国","中东",&#39;linux&#39;,"123","ww33##"]
for  i  in List2 :
    print (i)
print(List2)
结果:
openstack
云计算
python
中国
中东
linux
123
ww33##
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, &#39;中国&#39;, &#39;中东&#39;, &#39;linux&#39;, &#39;123&#39;, &#39;ww33##&#39;]
通过循环我们就可以找出列表的每个元素。同时我们也可以看出这时的打印和之前的有所不同
Copy after login

includes: We can judge whether a certain content is in the list. The return value of the result is a Boolean value Ture or False. If it exists, it is true and if it does not exist, it is false.

List2=[&#39;openstack&#39;,&#39;云计算&#39;,&#39;python&#39;,"中国","中东",&#39;linux&#39;,123,"ww33##"]
print( &#39;linuxww&#39;  in List2)
print(&#39;中东&#39; in List2)
print(123  in List2)
print( 12 in List2)
结果:
False
True
True
False
Copy after login

entend method Using this method, you can merge two lists into one without any impact on one of the values.

List2=[&#39;openstack&#39;,&#39;云计算&#39;,&#39;python&#39;,"中国","中东",&#39;linux&#39;,123,"ww33##"]
List1=[123,&#39;abc&#39;,&#39;中国&#39;]
#print( &#39;linuxww&#39;  in List2)
#print(&#39;中东&#39; in List2)
print(List2,List1)
print(List1)
List1.clear()
print(List1)
结果:
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, &#39;中国&#39;, &#39;中东&#39;, &#39;linux&#39;, 123, &#39;ww33##&#39;] [123, &#39;abc&#39;, &#39;中国&#39;]
[123, &#39;abc&#39;, &#39;中国&#39;]
[]
 
由此发现extend方法并不会影响被合并列表(List1)的值,只有自己做其他操作时才会发生变化。
Copy after login

copy() method

can realize the copying of the list

List2=[&#39;openstack&#39;,&#39;云计算&#39;,&#39;python&#39;,"中国","中东",&#39;linux&#39;,123,"ww33##"]
list3=List2.copy()
print(List2,list3)
结果:
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, &#39;中国&#39;, &#39;中东&#39;, &#39;linux&#39;, 123, &#39;ww33##&#39;]
 [&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, &#39;中国&#39;, &#39;中东&#39;, &#39;linux&#39;, 123, &#39;ww33##&#39;]
  
注意事项:
 List2=[&#39;openstack&#39;,&#39;云计算&#39;,&#39;python&#39;,["中国","中东"],&#39;linux&#39;,123,"ww33##"]
list3=List2.copy()
print(List2)
print(list3)
List2[2]="MYSQl DBA"
List2[3][1]="北京"
print(List2)
print(list3)
执行结果:
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, [&#39;中国&#39;, &#39;中东&#39;], &#39;linux&#39;, 123, &#39;ww33##&#39;]
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, [&#39;中国&#39;, &#39;中东&#39;], &#39;linux&#39;, 123, &#39;ww33##&#39;]
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;MYSQl DBA&#39;, [&#39;中国&#39;, &#39;北京&#39;], &#39;linux&#39;, 123, &#39;ww33##&#39;]
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, [&#39;中国&#39;, &#39;北京&#39;], &#39;linux&#39;, 123, &#39;ww33##&#39;]
我们将列表List2中的List2[2]的python和List2[3][1]的中东更改为List2[2]="MYSQl DBA"和List2[3][1]="北京
输出后发现复制的那一部分List2[3][1]复制后是一样的,而List2[2]的值会不一样。主要是内存的地址原因。
同时对这种情况想要复制相同的是不行的
List2=[&#39;openstack&#39;,&#39;云计算&#39;,&#39;python&#39;,["中国","中东"],&#39;linux&#39;,123,"ww33##"]
list3=List2
print(List2)
print(list3)
List2[2]="MYSQl DBA"
List2[3][1]="北京"
print(List2)
print(list3)
这里给list3赋值为List2这时会发现更改List2时,会直接更改list3的值
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, [&#39;中国&#39;, &#39;中东&#39;], &#39;linux&#39;, 123, &#39;ww33##&#39;]
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, [&#39;中国&#39;, &#39;中东&#39;], &#39;linux&#39;, 123, &#39;ww33##&#39;]
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;MYSQl DBA&#39;, [&#39;中国&#39;, &#39;北京&#39;], &#39;linux&#39;, 123, &#39;ww33##&#39;]
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;MYSQl DBA&#39;, [&#39;中国&#39;, &#39;北京&#39;], &#39;linux&#39;, 123, &#39;ww33##&#39;]
要想复制完全一样的,我们可以导入copy模块
import copy
List2=[&#39;openstack&#39;,&#39;云计算&#39;,&#39;python&#39;,["中国","中东"],&#39;linux&#39;,123,"ww33##"]
list3=copy.deepcopy(List2)
print(List2)
print(list3)
List2[2]="MYSQl DBA"
List2[3][1]="北京"
print(List2)
print(list3)
执行的结果:
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, [&#39;中国&#39;, &#39;中东&#39;], &#39;linux&#39;, 123, &#39;ww33##&#39;]
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, [&#39;中国&#39;, &#39;中东&#39;], &#39;linux&#39;, 123, &#39;ww33##&#39;]
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;MYSQl DBA&#39;, [&#39;中国&#39;, &#39;北京&#39;], &#39;linux&#39;, 123, &#39;ww33##&#39;]
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, [&#39;中国&#39;, &#39;中东&#39;], &#39;linux&#39;, 123, &#39;ww33##&#39;]
这时发现,List2元素的值改变不会影响list3的值,下面的这种copy,我们称为deep.copy,而列表的
copy()方法是一种浅copy
Copy after login

9. Other operations of the list

In addition to the above main operations, we You can also perform the following operations on the list. The operatorsfor + and * for lists are similar to those for strings. The + sign is used to combine lists, and the * sign is used to repeat lists

List2=[&#39;openstack&#39;,&#39;云计算&#39;,&#39;python&#39;,"中国","中东",&#39;linux&#39;,123]
list3=["open","ip","config"]
print(List2+list3)
print(list3*3 )
结果:
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, &#39;中国&#39;, &#39;中东&#39;, &#39;linux&#39;, 123, &#39;open&#39;, &#39;ip&#39;, &#39;config&#39;]
[&#39;open&#39;, &#39;ip&#39;, &#39;config&#39;, &#39;open&#39;, &#39;ip&#39;, &#39;config&#39;, &#39;open&#39;, &#39;ip&#39;, &#39;config&#39;]
+号实现的功能和之前的append()方式一样,而*表示重复,后面的的数字表示重复的次数。
Copy after login

python listfunction

Above we analyzed the python list method, and there is still a part of the python list List functions, common ones include max(list), min(list), len(list) and list(seq):

len(list) is the length of the list mentioned above,

max(list) The maximum value of the list

min(list) The minimum value of the list

list(seq) Convert tuples to lists, we know the basics of tuplesAttributes are the same as lists, the difference is that lists are defined using [] square brackets, while tuples are defined using () brackets, and the elements of tuples cannot be reassigned.

Example

List2=[&#39;openstack&#39;,&#39;云计算&#39;,&#39;python&#39;,"中国","中东",&#39;linux&#39;,123]
list3=["open","ip","config",&#39;999&#39;,&#39;2929&#39;,]
tet=("www","www",1234)
print(type(tet))
print(list(tet))
print(type(list(tet)))
print(List2+list3)
print(list3*3 )
print(len(list3))
print(max(list3))
print(min(list3))
 
结果:
<class &#39;tuple&#39;>  #元组tet的类型
[&#39;www&#39;, &#39;www&#39;, 1234] #print(list(tet))元组转换列表输出
<class &#39;list&#39;> #print(type(list(tet)))元组转化列表后的类型验证
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, &#39;中国&#39;, &#39;中东&#39;, &#39;linux&#39;, 123, &#39;open&#39;, &#39;ip&#39;, &#39;config&#39;, &#39;999&#39;, &#39;2929&#39;]
[&#39;open&#39;, &#39;ip&#39;, &#39;config&#39;, &#39;999&#39;, &#39;2929&#39;, &#39;open&#39;, &#39;ip&#39;, &#39;config&#39;, &#39;999&#39;, &#39;2929&#39;, &#39;open&#39;, &#39;ip&#39;, &#39;config&#39;, &#39;999&#39;, &#39;2929&#39;]
5 #print(len(list3))列表list3的长度统计
open  #print(max(list3)) 列表的最大值
2929  #print(min(list3)) 列表最小值
Copy after login

10. Nesting of lists

在上面讲到列表的copy()方法时,我们就用到了列表,因为列表的元素可以是任何类型,所以列表的元素还可以是列表,这时候的列表就会形成嵌套关系。

例如:

List2=[&#39;openstack&#39;,&#39;云计算&#39;,&#39;python&#39;,"中国","中东",[["open","ip"],"config",&#39;999&#39;,&#39;2929&#39;,]]
print(List2)
结果: 实现三层嵌套
[&#39;openstack&#39;, &#39;云计算&#39;, &#39;python&#39;, &#39;中国&#39;, &#39;中东&#39;, [[&#39;open&#39;, &#39;ip&#39;], &#39;config&#39;, &#39;999&#39;, &#39;2929&#39;]]
Copy after login

总结:以上内容主要是python中对列表的操作,全部属于基础知识,并且所有的示例都是亲手实践所得到的结果,由于经验不足,或许只能理解列表知识的一部分,哪里有错误,还请各位朋友指正。

The above is the detailed content of Introduction to common operations on lists in Python. For more information, please follow other related articles on the PHP Chinese website!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1670
14
PHP Tutorial
1274
29
C# Tutorial
1256
24
Python vs. C  : Learning Curves and Ease of Use Python vs. C : Learning Curves and Ease of Use Apr 19, 2025 am 12:20 AM

Python is easier to learn and use, while C is more powerful but complex. 1. Python syntax is concise and suitable for beginners. Dynamic typing and automatic memory management make it easy to use, but may cause runtime errors. 2.C provides low-level control and advanced features, suitable for high-performance applications, but has a high learning threshold and requires manual memory and type safety management.

Python and Time: Making the Most of Your Study Time Python and Time: Making the Most of Your Study Time Apr 14, 2025 am 12:02 AM

To maximize the efficiency of learning Python in a limited time, you can use Python's datetime, time, and schedule modules. 1. The datetime module is used to record and plan learning time. 2. The time module helps to set study and rest time. 3. The schedule module automatically arranges weekly learning tasks.

Python vs. C  : Exploring Performance and Efficiency Python vs. C : Exploring Performance and Efficiency Apr 18, 2025 am 12:20 AM

Python is better than C in development efficiency, but C is higher in execution performance. 1. Python's concise syntax and rich libraries improve development efficiency. 2.C's compilation-type characteristics and hardware control improve execution performance. When making a choice, you need to weigh the development speed and execution efficiency based on project needs.

Learning Python: Is 2 Hours of Daily Study Sufficient? Learning Python: Is 2 Hours of Daily Study Sufficient? Apr 18, 2025 am 12:22 AM

Is it enough to learn Python for two hours a day? It depends on your goals and learning methods. 1) Develop a clear learning plan, 2) Select appropriate learning resources and methods, 3) Practice and review and consolidate hands-on practice and review and consolidate, and you can gradually master the basic knowledge and advanced functions of Python during this period.

Python vs. C  : Understanding the Key Differences Python vs. C : Understanding the Key Differences Apr 21, 2025 am 12:18 AM

Python and C each have their own advantages, and the choice should be based on project requirements. 1) Python is suitable for rapid development and data processing due to its concise syntax and dynamic typing. 2)C is suitable for high performance and system programming due to its static typing and manual memory management.

Which is part of the Python standard library: lists or arrays? Which is part of the Python standard library: lists or arrays? Apr 27, 2025 am 12:03 AM

Pythonlistsarepartofthestandardlibrary,whilearraysarenot.Listsarebuilt-in,versatile,andusedforstoringcollections,whereasarraysareprovidedbythearraymoduleandlesscommonlyusedduetolimitedfunctionality.

Python: Automation, Scripting, and Task Management Python: Automation, Scripting, and Task Management Apr 16, 2025 am 12:14 AM

Python excels in automation, scripting, and task management. 1) Automation: File backup is realized through standard libraries such as os and shutil. 2) Script writing: Use the psutil library to monitor system resources. 3) Task management: Use the schedule library to schedule tasks. Python's ease of use and rich library support makes it the preferred tool in these areas.

Python for Web Development: Key Applications Python for Web Development: Key Applications Apr 18, 2025 am 12:20 AM

Key applications of Python in web development include the use of Django and Flask frameworks, API development, data analysis and visualization, machine learning and AI, and performance optimization. 1. Django and Flask framework: Django is suitable for rapid development of complex applications, and Flask is suitable for small or highly customized projects. 2. API development: Use Flask or DjangoRESTFramework to build RESTfulAPI. 3. Data analysis and visualization: Use Python to process data and display it through the web interface. 4. Machine Learning and AI: Python is used to build intelligent web applications. 5. Performance optimization: optimized through asynchronous programming, caching and code

See all articles