今天爱分享给大家带来写一个类,并让它尽可能多的支持澡作符?【面试题详解】,希望能够帮助到大家。
class Array:
__list = []
def __init__(self):
print "constructor"
def __del__(self):
print "destruct"
def __str__(self):
return "this self-defined array class"
def __getitem__(self,key):
return self.__list[key]
def __len__(self):
return len(self.__list)
def Add(self,value):
self.__list.append(value)
def Remove(self,index):
del self.__list[index]
def DisplayItems(self):
print "show all items---"
for item in self.__list:
print item
常见问题
不显示资源下载框怎么办?
请更换谷歌,微软,火狐等浏览器
微云登录不了,或者重复提示登录?
请更换浏览器,最好使用微软,谷歌,火狐。国产浏览器不好用
原文链接:https://itblood.website/4199.html,转载请注明出处。
