python基本数据类型操作总结

一:list

  1.   append
  2.   count
  3.   insert
  4.  reverse
  5.   clear
  6.   extend
  7.   pop
  8.  sort
  9.  copy
  10.   index
  11.   remove

二:dict

  1.   clear
  2.   get
  3.  pop
  4.   update
  5.   copy
  6.   items
  7.  popitem  values
  8.   fromkeys
  9.   keys
  10.   setdefault

三: tuple

  1.  count
  2. index

四:set

  1.  add()  
  2.  difference_update()
  3.  isdisjoint()
  4.  clear()                      
  5.  discard()                    
  6.  issubset()
  7.  copy()                        
  8.  intersection()                
  9.  issuperset()                           
  10.  difference()                  
  11.  intersection_update()        
  12.  pop()

五:str

  1.  capitalize()  
  2. encode()      
  3. format()      
  4. isalpha()      
  5. islower()      
  6. istitle()      
  7. lower()       
  8. casefold()    
  9. endswith()    
  10. format_map()  
  11. isdecimal()    
  12. isnumeric()    
  13. isupper()    
  14.  lstrip()       
  15. center()      
  16. expandtabs()  
  17. index()      
  18.  isdigit()      
  19. isprintable()  
  20. join()        
  21. maketrans()    
  22. count()        
  23. find()        
  24. isalnum()      
  25. isidentifier()
  26. isspace()    
  27.  ljust()        
  28. partition()
  29. replace()    
  30. rpartition()  
  31. splitlines()  
  32. title()
  33. rfind()      
  34. rsplit()      
  35. startswith()  
  36. translate()
  37. rindex()      
  38. rstrip()      
  39. strip()        
  40. upper()
  41. rjust()        
  42. split()        
  43. swapcase()    
  44. zfill()

猜你喜欢

转载自blog.csdn.net/wjg1314521/article/details/100139429