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

 

相关文章:

  • 2022-01-25
  • 2022-12-23
  • 2022-12-23
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
猜你喜欢
  • 2021-07-21
  • 2021-10-03
  • 2021-08-16
  • 2021-05-12
  • 2022-12-23
  • 2021-06-19
  • 2021-08-12
相关资源
相似解决方案