•        Python : 3.7.0
  •          OS : Ubuntu 18.04.1 LTS
  •         IDE : PyCharm 2018.2.4
  •       Conda : 4.5.11
  •    typesetting : Markdown

code

coder@Ubuntu:~$ source activate py37
(py37) coder@Ubuntu:~$ ipython
Python 3.7.0 (default, Jun 28 2018, 13:15:42)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: my_str = 'hello!' In [2]: # 在o的后面,即索引值为4的元素后面插入新的字符串 In [3]: my_str = my_str[:5] + 'world' + my_str[5:] In [4]: my_str
Out[4]: 'helloworld!' In [5]: # 操作进行到这里, 'hello!'字符串依然存在,再过一会因为没有标签指向它,
...: 会被回收 In [6]: exit
(py37) coder@Ubuntu:~$ source deactivate
coder@Ubuntu:~$

resource

  • [文档] docs.python.org/3
  • [规范] www.python.org/dev/peps/pep-0008
  • [规范] zh-google-styleguide.readthedocs.io/en/latest/google-python-styleguide/python_language_rules
  • [源码] www.python.org/downloads/source
  • [ PEP ] www.python.org/dev/peps
  • [平台] www.cnblogs.com
  • [平台] gitee.com


Python具有开源、跨平台、解释型、交互式等特性,值得学习。

Python的设计哲学:优雅,明确,简单。提倡用一种方法,最好是只有一种方法来做一件事。

代码的书写要遵守规范,这样有助于沟通和理解。

每种语言都有独特的思想,初学者需要转变思维、踏实践行、坚持积累。

Python3基础 str 通过拆分字符串与插入新的内容形成新的字符串的更多相关文章

  1. Python3基础 str while+iter+next 字符串的遍历

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  2. Python3基础 str casefold 返回全是小写字母的新字符串

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  3. Python3基础 str capitalize 返回新字符串,第一个字母大写

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  4. Python3基础 str : 对字符串进行切片

             Python : 3.7.3          OS : Ubuntu 18.04.2 LTS         IDE : pycharm-community-2019.1.3    ...

  5. Python3基础 str split 用指定的字符将字符串分割

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  6. Python3基础 str lstrip 去掉字符串左边的空格

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  7. Python3基础 str partition 以参数字符串切分字符串,只切分为三部分

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  8. Python3基础 str for 输出字符串中的每个字符

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  9. Python3基础 str find+index 是否存在指定字符串,有则返回第一个索引值

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

随机推荐

  1. 97.394570112228 - Query OK, 1 row affected (43.05 sec) - the overhead of parsing and network communication

    mysql> create table w0904procedure (wa char, wb char, wd char, wi char); Query OK, rows affected ...

  2. JQUERY中各个ajax函数

    1.$(selecter).load()     --- load() 方法从服务器加载数据,并把返回的数据放入被选元素中 2.$.get(url,callback()) 3.$.post(url,d ...

  3. kubernetes实战(十五):k8s使用helm持久化部署jenkins集成openLDAP登录

    1.基本概念 Jenkins在DevOps工具链中是核心的流程管理中心,负责串联系统的构建流程.测试流程.镜像制作流程.部署流程等,在持续集成中常用到的工具如下: Maven:源代码编译工具 Robo ...

  4. R之ddlpy函数学习[转载]

    转自:https://www.cnblogs.com/aloiswei/p/6032513.html 1.函数 ddply(.data, .variables, .fun = NULL, ..., . ...

  5. weka源代码-总述

    分类: 所有的分类器都继承自抽象类AbstractClassifier而AbstractClassifier继承自接口Classifier.集成关系如下图所示: 而类Classifier中主要包含以下 ...

  6. jxl(Java Excel API) 使用方法 【2】

    JAVA EXCEL API简介 Java Excel是一开放源码项目,通过它Java开发人员可以读取Excel文件的内容.创建新的Excel文件.更新已经存在的Excel文件.使用该 API非Win ...

  7. Lintcode: Lowest Common Ancestor

    Given the root and two nodes in a Binary Tree. Find the lowest common ancestor(LCA) of the two nodes ...

  8. 修改SQL Server 的排序规则(转)

    转自http://jimshu.blog.51cto.com/3171847/1095780/ 一.修改SQL Server服务器(实例)的排序规则 以下实验使用了SQL Server 2008 R2 ...

  9. UVALive - 7261 Xiongnu's Land

    思路: 先二分下界,再二分上届. #include <bits/stdc++.h> using namespace std; #define MP make_pair #define PB ...

  10. c# 模拟get请求例子,演示Session会话状态。

    创建一个控制台 程序: using System; using System.Collections.Generic; using System.IO; using System.IO.Compres ...