列出常见类型的方法:
def ListFunctions(lists): print ("------------------------------------------") print (type(lists)) for item in dir(lists): if ( not item.startswith("__")): print (item)
#listl = [1, 2, 3] #or list(1,2,3)ListFunctions(l)# tuplet = (1, 2, 3)ListFunctions (t)#sets = {1, 2, 3} #or set(1,2,3)ListFunctions(s)#dict
d = {1:'1v', 2:'2v', 3:'3v'} #or dict(1:'1v', 2:'2v', 3:'3v')ListFunctions(d)#strmyStr="123" #or str("123")ListFunctions(myStr)
#filefile = open("te......
阅读全文