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()的更多相关文章

  1. Python自学:第二章 合并(拼接字符串)

    first_name = "ada" last_name = "lovelace" full_name = first_name + " " ...

  2. Python自学:第二章 Python之禅

    >>print import <Python之禅>,提姆·彼得斯著 美胜于丑. 显式优于隐式. 简单胜于复杂. 复杂总比复杂好. 平的比嵌套的好. 稀疏胜于稠密. 可读性计数. ...

  3. Python自学:第二章 注释

    #向大家问好 print("Hello Python People") 输出为 Hello Python People

  4. Python自学:第二章 删除空白

    lstrip:剔除开头空白 strip:剔除两段空白 rstrip:剔除末尾空白 favorite: 最喜欢的 >>>favorite_language = "Python ...

  5. Python自学:第二章 使用制表符或换行符来添加空白

    print("Languages:\n\tPython\n\tC\n\tJava") 输出为: Languages: Python C Java

  6. Python自学:第二章 动手试一试

    print(1 + 7) print(16 - 8) print(2 * 4) print(8 / 1) 输出为: 8 8 8 8.0 message = " print("I l ...

  7. Python自学:第二章 使用函数str( )避免类型错误

    age = 23 message = "Happy " + str(age) + "rd Birthday" print(message) 输出位 Happy ...

  8. Python自学:第二章 浮点数

    >>>0.1 + 0.1 0.2 >>>0.2 + 0.2 0.4 >>>2 * 0.1 0.2 >>>2 * 0.2 0.4

  9. Python自学:第二章 数字 整数

    >>>2 + 3 5 >>>3 - 2 1 >>>3 * 2 6 >>>3 / 2 1.5

随机推荐

  1. day24,25组合 封装 多态

    面向对象的精髓:将数据和处理数据的代码绑定成一个对象 只要获取到对象相应的数据和方法都有了 一.组合 什么叫组合? 多个对象放在一起叫组合 组合的作用也是降低代码的冗余 # 学生会增加各种各样的新的属 ...

  2. topcoder srm 684 div1

    problem1 link 首先由$P$中任意两元素的绝对值得到集合$Q$.然后枚举$Q$中的每个元素作为集合$D$中的最大值$Max$,这样就能确定最后集合$D$中的最小值要大于等于$Min=\fr ...

  3. Python3 tkinter基础 Label imag显示图片

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

  4. Python3基础 e记法示例

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

  5. Win10 使用命令修复系统坏死点

    我的电脑win10系统升级多次以后,经常会出现所有设置有时点不开的情况 解决: C:\WINDOWS\system32>sfc /SCANNOW 开始系统扫描.此过程将需要一些时间. 开始系统扫 ...

  6. jvm:垃圾收集器

    垃圾收集器: Serial 收集器: 单线程收集器,专注做收集,会暂停别的工作.收集效果好. ParNew 收集器: 是Serial的多线程版本.目前只有它能和CMS收集器配合.    Paralle ...

  7. 函数嵌套函数传递this值

    <button onclick="demo()(this)">test</button> function demo(){ return function ...

  8. Docker5之Deploy your app

    Make sure you have published the friendlyhello image you created by pushing it to a registry. We’ll ...

  9. HDU 6249 Alice’s Stamps(dp)

    http://acm.hdu.edu.cn/showproblem.php?pid=6249 题意: 给出n个区间,求选k个区间的最大区间并. 思路: 可能存在左端点相同的多个区间,那么此时我们肯定选 ...

  10. BZOJ 1143: [CTSC2008]祭祀river(二分图最大点独立集)

    http://www.lydsy.com/JudgeOnline/problem.php?id=1143 题意: 思路: 二分图最大点独立集,首先用floyd判断一下可达情况. #include< ...