zoukankan      html  css  js  c++  java
  • 001_python字符串简单操作

    str

    1 re = s1.index('a')
    2 # re = s1.index('a',2)
    3 re = s1.index('a',2,55)# no out of range
    4 # re = s1.index('y')#ValueError: substring not found
    5 # lowest index
    6 # Raises ValueError
    7 print(re)
    你好吗?
    re = s1.index('a')
    # re = s1.index('a',2)
    re = s1.index('a',2,55)# no out of range
    # re = s1.index('y')#ValueError: substring not found
    # lowest index
    # Raises ValueError
    print(re)
    1 re = s1.index('a')
    2 # re = s1.index('a',2)
    3 re = s1.index('a',2,55)# no out of range
    4 # re = s1.index('y')#ValueError: substring not found
    5 # lowest index
    6 # Raises ValueError
    7 print(re)
    index
    1 re = s1.index('a')
    2 # re = s1.index('a',2)
    3 re = s1.index('a',2,55)# no out of range
    4 # re = s1.index('y')#ValueError: substring not found
    5 # lowest index
    6 # Raises ValueError
    7 print(re)
  • 相关阅读:
    Redis常见数据类型
    MYSQL常见可优化场景
    算术切片
    找数组里没出现的数
    不同路径和(II)
    不同路径和
    最小路径和
    强盗抢房子
    丑数(2)
    判断子序列
  • 原文地址:https://www.cnblogs.com/haizinihao/p/13265284.html
Copyright © 2011-2022 走看看