Python's sys.path is a list. Why did append become None after that?

jupyter run

import sys
print(type(sys.path))
try:
    sys.path=sys.path.append("test")
except Exception as e:
    print(e)
print(sys.path)

< class" list" >
None

Mar.12,2022

In [1]: import sys

In [2]: sys.path
Out[2]:
['',
 'D:\\Program Files\\Python36\\Scripts\\ipython.exe',
 'd:\\program files\\python36\\python36.zip',
 'd:\\program files\\python36\\DLLs',
 'd:\\program files\\python36\\lib',
 'd:\\program files\\python36',
 'C:\\Users\\Jam\\AppData\\Roaming\\Python\\Python36\\site-packages',
 'd:\\program files\\python36\\lib\\site-packages',
 'd:\\program files\\python36\\lib\\site-packages\\win32',
 'd:\\program files\\python36\\lib\\site-packages\\win32\\lib',
 'd:\\program files\\python36\\lib\\site-packages\\Pythonwin',
 'd:\\program files\\python36\\lib\\site-packages\\IPython\\extensions',
 'C:\\Users\\Jam\\.ipython']

In [3]: sys.path.append('test')

In [4]: sys.path
Out[4]:
['',
 'D:\\Program Files\\Python36\\Scripts\\ipython.exe',
 'd:\\program files\\python36\\python36.zip',
 'd:\\program files\\python36\\DLLs',
 'd:\\program files\\python36\\lib',
 'd:\\program files\\python36',
 'C:\\Users\\Jam\\AppData\\Roaming\\Python\\Python36\\site-packages',
 'd:\\program files\\python36\\lib\\site-packages',
 'd:\\program files\\python36\\lib\\site-packages\\win32',
 'd:\\program files\\python36\\lib\\site-packages\\win32\\lib',
 'd:\\program files\\python36\\lib\\site-packages\\Pythonwin',
 'd:\\program files\\python36\\lib\\site-packages\\IPython\\extensions',
 'C:\\Users\\Jam\\.ipython',
 'test']
The append of

list will not return a value, but will directly operate list

Menu