python学习(二十二) String
Posted 刘大飞
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python学习(二十二) String相关的知识,希望对你有一定的参考价值。
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:UsersFeiLiuAppDataLocalProgramsPythonPython36python.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的主要内容,如果未能解决你的问题,请参考以下文章