Python3基础 str __add__ 拼接,原字符串不变
- Python : 3.7.3
- OS : Ubuntu 18.04.2 LTS
- IDE : pycharm-community-2019.1.3
- Conda : 4.7.5
- typesetting : Markdown
code
coder@ubuntu:~$ conda activate py37
(py37) coder@ubuntu:~$ ipython
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.5.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: hello = "hello"
In [2]: hello.__add__(" world")
Out[2]: 'hello world'
In [3]: hello
Out[3]: 'hello'
In [4]: exit
(py37) coder@ubuntu:~$ conda deactivate
coder@ubuntu:~$
source_code
def __add__(self, *args, **kwargs): # real signature unknown
""" Return self+value. """
pass
resource
- [文档 - English] docs.python.org/3
- [文档 - 中文] docs.python.org/zh-cn/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 __add__ 拼接,原字符串不变的更多相关文章
- Python3基础 str capitalize 返回新字符串,第一个字母大写
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str while+iter+next 字符串的遍历
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str partition 以参数字符串切分字符串,只切分为三部分
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str count 获得子字符串出现的次数
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础02(列表和字符串处理)
str = 'Runoob'# 输出字符串print(str) # 输出第一个到倒数第二个的所有字符print(str[0:-1]) # 输出字符串第一个字符print(str[0]) # 输出从第三 ...
- Python3基础 str ljust-rjust-center 左、右对齐 居中
Python : 3.7.3 OS : Ubuntu 18.04.2 LTS IDE : pycharm-community-2019.1.3 ...
- Python3基础 str + 字符串变量拼接
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str *运算 重复拼接字符串
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- Python3基础 str 通过拆分字符串与插入新的内容形成新的字符串
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
随机推荐
- Redis的竞争并发该如何解决?
这个也是线上非常常见的一个问题,就是多客户端同时并发写一个key,可能本来应该先到的数据后到了,导致数据版本错了.或者是多客户端同时获取一个key,修改值之后再写回去,只 要顺序错了,数据就错了. 而 ...
- 03 c++中this指针
概念: 成员函数:在类中定义的函数.普通函数无法被继承,成员函数可以被继承.友元函数相当于普通函数. 友元函数不是类的组成,没有this指针,必须将成员函数操作符作为参数传递对象. 在c++中成员函数 ...
- 关于Spring的常用注解和接口
接口 1. BeanPostProcessor 2. FactoryBean 3. Condition 4. ImportSelector 5. ImportBeanDefinitionRegitra ...
- 关于List集合中元素排序问题
问题描述: 有一个list集合,其中元素是Student对象,根据student的age排序. Student对象 /** * description * * @author 70KG * @date ...
- vs2010出现红色波浪错误提示但运行通过
1.环境:xp+VS2010 2.问题:突然发现编辑器里的代码在没有错误的地方提示很多不存在的错误,显示红色波浪线,但能顺利编译运行. 3.解决: 对于32位机来说,先查看注册表: [HKEY_CLA ...
- IDEA 中tomcat图片储存和访问虚拟路径(图片和程序分家)
本文链接:https://blog.csdn.net/qq_36481052/article/details/78813213 **前段时间,遇到了图片已经储存了文件中也显示有图片,但就是死活访问不到 ...
- [TypeScript] Modifier
TypeScript 2.8 adds the ability for a mapped type to either add or remove a particular modifier. Spe ...
- YAML_03 用playbook安装Apache,修改端口,配置ServerName,修改主页,设置开机自启
ansible]# vim http.yml --- - hosts: cache remote_user: root tasks: - name: install one speci ...
- Navicat连接mysql报错1251 -client does not support authentication protocol
原文https://blog.csdn.net/qq_35654080/article/details/82588188 详解请参考https://blog.csdn.net/chszs/articl ...
- Comet OJ - Contest #8题解
传送门 \(A\) 咕咕咕 const int N=1005; char s[N][N];int len[N],n,id; inline bool cmp(R int j,R int k){ R in ...