PYTHON's problem with empty list checking

1. Invalid code for empty list detection
2. Code:
admin_list= ["admin","zeyu","xx","yy","zz"]
admin_list2 = admin_list
print (admin_list2)
del admin_list2 [:]
print (admin_list2)

< H1 > the following code does not report an error, but does not display the running content < / H1 >

if admin_list2:

for admin2 in admin_list2:
    print("welcome"+admin2)
else:
    print("we need to find some users!")
  
< H1 > ask the great god for an answer < / H1 >
Feb.28,2021
When

del admin_list2 [:], only the values in the list are deleted, but not the list itself. There is also
in admin_list2. When if judges, because it is an empty list, it is because False
does not enter the traversal below


where else should not be indented, but should be aligned with if

.
Menu