首页 > 其他 > 详细

修改字符串大小写

时间:2018-12-15 11:13:07      阅读:146      评论:0      收藏:0      [点我收藏+]
name = "ada lovelace"
print(name.title())
Ada Lovelace
name2 = "Ada Lovelace"
print(name2.upper())
ADA LOVELACE
print(name2.lower())
ada lovelace
firstname = "ada"
lastname = "lovelace"
fullname = firstname+" "+lastname
print(fullname)
ada lovelace
print(fullname.title())
Ada Lovelace
print("Hello,"+fullname.title()+"!")
Hello,Ada Lovelace!
print("\tpython")
    python

 


>>> message="langueages:\nPython\nC\nJavaScript"
>>> print(message)
langueages:
Python
C
JavaScript
>>> message="python "
>>> message
python 
>>> message.rstrip()
python
>>> message
python 
>>> hehe = " python "
>>> hehe
 python 
>>> hehe.rstrip()
 python
>>> hehe.lstrip()
python 
>>> hehe.strip()
python
>>> hehe.rstrip()
 python

 


 

 

 

修改字符串大小写

原文:https://www.cnblogs.com/puyitian/p/10122646.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!