摘要:
1、 >>> a = ["aa","cc","aa","bb","bb","aa","dd","ee"] >>> a ['aa', 'cc', 'aa', 'bb', 'bb', 'aa', 'dd', 'ee'] >>> "aa" in 阅读全文
摘要:
>>> a = ["dd","cc","aa","bb"] >>> a ['dd', 'cc', 'aa', 'bb'] >>> b = sorted(a) ## 排序并赋值给b >>> b ['aa', 'bb', 'cc', 'dd'] >>> a ['dd', 'cc 阅读全文
摘要:
>>> a = ["aa","bb","cc","dd","ee","ff","gg","hh"] >>> a ['aa', 'bb', 'cc', 'dd', 'ee', 'ff', 'gg', 'hh'] >>> a.pop() ## pop删除 阅读全文
摘要:
>>> a = ["aa","bb","cc"] ## 创建列表 >>> a ['aa', 'bb', 'cc'] >>> a.append("dd") ## append添加 >>> a ['aa', 'bb', 'cc', 'dd'] >>> a.extend(["ee"]) >> 阅读全文