Python自学:第二章 删除空白
lstrip:剔除开头空白
strip:剔除两段空白
rstrip:剔除末尾空白
favorite: 最喜欢的
>>>favorite_language = "Python"
>>>favorite_language.lstrip()
"python "
>>>favorite_language.strip()
"python"
>>>favorite_language.rstrip()
" python"
Python自学:第二章 删除空白的更多相关文章
- Python自学:第二章 使用制表符或换行符来添加空白
print("Languages:\n\tPython\n\tC\n\tJava") 输出为: Languages: Python C Java
- Python自学:第二章 Python之禅
>>print import <Python之禅>,提姆·彼得斯著 美胜于丑. 显式优于隐式. 简单胜于复杂. 复杂总比复杂好. 平的比嵌套的好. 稀疏胜于稠密. 可读性计数. ...
- Python自学:第二章 注释
#向大家问好 print("Hello Python People") 输出为 Hello Python People
- Python自学:第二章 动手试一试
print(1 + 7) print(16 - 8) print(2 * 4) print(8 / 1) 输出为: 8 8 8 8.0 message = " print("I l ...
- Python自学:第二章 使用函数str( )避免类型错误
age = 23 message = "Happy " + str(age) + "rd Birthday" print(message) 输出位 Happy ...
- Python自学:第二章 浮点数
>>>0.1 + 0.1 0.2 >>>0.2 + 0.2 0.4 >>>2 * 0.1 0.2 >>>2 * 0.2 0.4
- Python自学:第二章 数字 整数
>>>2 + 3 5 >>>3 - 2 1 >>>3 * 2 6 >>>3 / 2 1.5
- Python自学:第二章 合并(拼接字符串)
first_name = "ada" last_name = "lovelace" full_name = first_name + " " ...
- Python自学:第二章 修改字符串的大小写 titile.()、upper()、lower()
title.():首字母大写 upper():全大写 lower():全小写 ada lovelace:人名,传控计算机创始人 name = "ada lovelace" prin ...
随机推荐
- mysqldump: Couldn't execute 'SHOW VARIABLES LIKE 'ndbinfo_version'': Native table 'performance_schema'.'session_variables' has the wrong structure (1682)
centos7.5 导出整个数据库报错 问题: [root@db01 ~]# mysqldump -uroot -pBgx123.com --all-databases --single-transa ...
- ant安装
- WSDL(Web服务描述语言)详细解析(全文转载学习用)
WSDL (Web Services Description Language,Web服务描述语言)是一种XML Application,他将Web服务描述定义为一组服务访问点,客户端可以通过这些服务 ...
- tp框架中的一些疑点知识-1
tp默认的编码是utf-8 Runtime中的Cache和Logs都是分模块的,因为在应用app下可以有多个模块,但是 公共模块和Runtime模块只有一个, 所以, Runtime要包含各个模块的内 ...
- using Redis in .net core
Using Redis Cache in .net Core Distributed Cache using Redis and ASP.NET Core ASP.NET Core Data Prot ...
- Kubernetes相关概念
This page explains how Kubernetes objects are represented in the Kubernetes API, and how you can exp ...
- 最大匹配字符串LCS,The Longest Common Substring
public enum BackTracking { UP, LEFT, NEITHER, UP_AND_LEFT } public abstract class LCSBaseMatch { /// ...
- TortoiseGit自动记住用户名密码的方法
TortoiseGit自动记住用户名密码的方法 windows下比较比较好用的git客户端有2种: msysgit + TortoiseGit(乌龟git) GitHub for Windows gi ...
- 3、python内置类型(0529)
python的内置对象类型以及支持的运算 python对象的相关术语 python程序中保存的所有数据都是围绕对象这个概念展开的 程序中存储的所有数据都是对象 每个对象都有一个身份.一个类型和一个值 ...
- ASP.NET开发总结
ASP.NET的界面可以是.aspx,会对应有一个.aspx.cs的逻辑处理文件,.aspx的所有控件对应着变量,变量名就是控件的ID. 为了代码编写方便起见,一般将数据库表的新增字段,放在最后. 日 ...