Python自学:第二章 修改字符串的大小写 titile.()、upper()、lower()
title.():首字母大写
upper():全大写
lower():全小写
ada lovelace:人名,传控计算机创始人
name = "ada lovelace" print(name.title())
print(name.upper())
print(name.lower())
输出如下:
Ada Lovelace
ADA LOVELACE
ada lovelace
Python自学:第二章 修改字符串的大小写 titile.()、upper()、lower()的更多相关文章
- Python自学:第二章 合并(拼接字符串)
first_name = "ada" last_name = "lovelace" full_name = first_name + " " ...
- Python自学:第二章 Python之禅
>>print import <Python之禅>,提姆·彼得斯著 美胜于丑. 显式优于隐式. 简单胜于复杂. 复杂总比复杂好. 平的比嵌套的好. 稀疏胜于稠密. 可读性计数. ...
- Python自学:第二章 注释
#向大家问好 print("Hello Python People") 输出为 Hello Python People
- Python自学:第二章 删除空白
lstrip:剔除开头空白 strip:剔除两段空白 rstrip:剔除末尾空白 favorite: 最喜欢的 >>>favorite_language = "Python ...
- Python自学:第二章 使用制表符或换行符来添加空白
print("Languages:\n\tPython\n\tC\n\tJava") 输出为: Languages: Python C Java
- 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
随机推荐
- spring动态创建数据源
在最近的项目业务中,需要在程序的运行过程中,添加新的数据库添链接进来,然后从新数据库链接中读取数据. 网上查阅了资料,发现spring为多数据源提供了一个抽象类AbstractRoutingDataS ...
- Python3基础 dict clear 清空一个字典
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- android 6 中init.rc的生成过程【转】
本文转载自:https://blog.csdn.net/quhj/article/details/51819638 android 系统开机是会有一个初始化过程 init ,整个初始化过程是根据配置脚 ...
- 【POJ1509】Glass Beads
[POJ1509]Glass Beads [题目描述]给定字符串S,并规定首尾相连成环,求出最小字典序. [输入]输入有多个数据,第一行只包括正整数N,表示有N组数据.每个数据包括一行,输入该字符串. ...
- tp框架中的一些疑点知识-4
$_SERVER的几个元素: script_name脚本名称, 是指这个脚本文件本身的文件名, 通常只是 : /index.php path_info: 是从控制器/操作方法开始到最后的内容,包括路径 ...
- 一些常用的mysql语句实例-以后照写
create database blog; create table blog_user ( user_Name char(15) not null check(user_Name !=''), us ...
- 从0开始安装fedora23的笔记-- 以及使用fedora的常规问题-2
在shell中, 你是可以连续输入多个语句的, 中间用分号; 连接 也可以把这些多个语句放到一个函数中, 函数的话,便于多次引用. 而且 "封装" 为函数后, 可以用set查看到这 ...
- 如何创建并运行java线程 , 多线程使用
http://www.importnew.com/20672.html https://www.cnblogs.com/wxd0108/p/5479442.html https://www.cnblo ...
- 论文笔记:Learning how to Active Learn: A Deep Reinforcement Learning Approach
Learning how to Active Learn: A Deep Reinforcement Learning Approach 2018-03-11 12:56:04 1. Introduc ...
- ETCD应用
etcd:从应用场景到实现原理的全方位解读 ETCD:A highly-available key value store for shared configuration and service d ...