python零碎知识点

 

1.argparse

2.replace

 


 

1.argparse

  argparse tutorial地址:https://docs.python.org/3/howto/argparse.html#introducing-positional-arguments

2.replace

  replace()方法把字符串中的old(字符串)换成new(字符串),若指定第三个参数,则是规定替换不超过n次

>>>str = "this is string example....wow!!! this is really string"
>>>print str.replace("is", "was")
thwas was string example....wow!!! thwas was really string

 

posted on 2019-09-09 21:28  一粒蜗牛  阅读(118)  评论(0)    收藏  举报

导航