zoukankan      html  css  js  c++  java
  • python 学习笔记12(序列常用方法总结)

    http://www.cnblogs.com/vamei/archive/2012/07/19/2599940.html

    多回想!!!

    1. 序列(list,tuple,string)

    len(s)   

    min(s)

    max(s)

    any(s)

    all(s)

    2. 表和定值表(list,tuple):

    sum(s)

    s.count(x)

    s.index(x)

    3. 表 list:

    list1.extend(list2)

    list1.append(x)

    list1.sort()

    list1.reverse()

    list1.pop()

    del  list1[1]

    4. 字符串:

    str.count(sub)

    str.find(sub)

    str.index(sub)

    str.rfind(sub)

    str.rindex(sub)

    5.  字符串判断

    str.isalnum()        

    str.isalpha()        

    str.isdigit()        

    str.istitle()        

    str.isspace()        

    str.islower()        

    str.isupper()        

    str.split([sep, [max]])    

    str.rsplit([sep, [max]])  

    str.rsplit(',')

    str.join(s)                

    str.strip([sub])            

    str.replace(sub, new_sub)  

             

    str.capitalize()           

    str.lower()                

    str.upper()                

    str.swapcase()             

    str.title()                

    str.center(width)          

    str.ljust(width)           

    str.rjust(width)           

  • 相关阅读:
    实现一个简易的Spring MVC
    解决IntelIij DEA控制台乱码
    01、SpringBoot中关于tomcat的一些常用配置
    Java动态代理的简单实现
    MVVM中viewmodel的理解
    eclipse常用快捷键
    导入mysql报错问题
    mysql主从配置思路
    rpm安装jdk7
    13个开源GIS软件 你了解几个?
  • 原文地址:https://www.cnblogs.com/skyEva/p/5490599.html
Copyright © 2011-2022 走看看