目录
描述
Python中的str类是Python的字符串类。str类提供了各种字符串处理方法。
创建字符串
使用单引号'创建字符串
>>> a_string = 'MacBook Pro is a computer.'
>>> a_string
'MacBook Pro is a computer.'
>>> type(a_string)
<class 'str'>
1.2 使用双引号"创建字符串
>>> a_string = "Huawei 5G technology is very good."
>>> a_string
'Huawei 5G technology is very good.'
>>> type(a_string)
<class 'str'>
⚠️双引号内包裹