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
随机推荐
- 【Python48--魔法方法:迭代器&生成器】
一.迭代器 1.iter() __iter__() 2.next() __next__() 二.用while语句实现for语句相同的功能 for each in range(5): print(eac ...
- POJ 1751 Highways 【最小生成树 Kruskal】
Highways Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 23070 Accepted: 6760 Speci ...
- yum命令showduplicates安装指定版本包
默认情况下,我们用yum list 或者 yum install 的时候,yum会默认选择最新的版本. 如果我们需要安装指定版本的某个软件包,以使之能够和我们现有环境的软件包版本匹配,那么就需要用到s ...
- sonarqube中new issue的标准
https://docs.sonarqube.org/latest/user-guide/issues/#header-4 Understanding which Issues are "N ...
- How to check if one path is a child of another path?
How to check if one path is a child of another path? Unfortunately it's not as simple as StartsWith. ...
- IE8下面parseInt('08')、parseInt('09')会转成0
例子: <html> <body> <script type="text/javascript"> for(var i=1;i<=20;i ...
- Unity3D学习笔记(三十八):VR开发
设备安装:HTC View 驱动安装:Steam - SteamVR 设备激活 Unity开发 下载安装开发包 Asset Store - SteamVR Plugin SteamVRDemo1- ...
- HDU 6203 ping ping ping(dfs序+LCA+树状数组)
http://acm.hdu.edu.cn/showproblem.php?pid=6203 题意: n+1 个点 n 条边的树(点标号 0 ~ n),有若干个点无法通行,导致 p 组 U V 无法连 ...
- 在GeoServer里设置图层的默认自定义样式,出现不显示预览图的情况(不起作用)
在GeoServer里设置图层的默认自定义样式 点击"Layers-->world:country"图层,点击"Publishing"标签,在下面的&qu ...
- 针对list集合进行分页展示
直接定义个工具类,代码如下: package com.jk51.modules.wechat.web.util; import java.util.Collections; import java.u ...