Python中字符串的创建方法有以下几种:
str1 = 'Hello World'
str2 = "Python is awesome"
str3 = '''This is a
multi-line string'''
str4 = 'I\'m a programmer'
str5 = "He said, \"Hello World\""
str6 = r'C:\Users\Username\Desktop'
name = 'Alice'
age = 25
str7 = 'My name is {} and I am {} years old'.format(name, age)
str8 = 'Hello' + ' ' + 'World'
str9 = 'Python' * 3
需要注意的是,字符串是不可变的,即不能对字符串进行修改,但可以通过创建新的字符串来实现对字符串的修改。