首页 > 编程语言 > 详细

python学习(二十二) String

时间:2018-10-22 17:38:46      阅读:139      评论:0      收藏:0      [点我收藏+]

 

 

str1 = "This is a test"
print(str1)

str1 = This is a "test"
print(str1)

str1 = "This is a \"test\""
print(str1)

str1 = This is a \test\ 
print(str1)

str1 = "This is a single string"
print(str1)

‘‘
len()
lower()
upper()
str()
‘‘

print(len("abc"))
print("aAbc".lower())
print("abc".upper())
print("abc" +  str(2))
print("hello" + " " + "world")

result:

C:\Users\FeiLiu\AppData\Local\Programs\Python\Python36\python.exe C:/Users/FeiLiu/PycharmProjects/GetBluePageInfo/src/stringTest.py
This is a test
This is a "test"
This is a "test"
This is a test 
This is a single string
3
aabc
ABC
abc2
hello world

 

python学习(二十二) String

原文:https://www.cnblogs.com/liufei1983/p/9831048.html

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