2.2.1命名的说明
只能包含:字母,下划线,数字
必须:字母,下划线为首
不能有空格,可以有下划线
慎用小写字母的l和o会跟1和0混淆
2.3字符串
用引号引起来的就是字符串(单引号,双引号都可以)
2.3.1使用方法修改字符串的大小写
name='hello world'
print(name.title())
print(name.upper())
print(name.lower())

2.3.2 在字符串中使用变量
f字符串
f是format(设置格式)的简写
first_name="ada"
last_name="loveyou"
full_name=f"{first_name} {last_name}"
print(full_name)

2.3.3 制表符 和 换行符
制表符 \t
换行符 \n
print('python')
print("制表符:")
print('\tpython')
print("换行符:")
print('\npython')
print('\n\tpython')

2.5.4删除空白
删除左空白 lstrip()
删除右空白 rstrip()
删除两端空白 strip()
name=' python '
print("删除")
print(name)
print(name.rstrip())
print(name.lstrip())
print(name.strip())

2.5.5 删除前缀+后缀
url='http://csdn.com'
dele=url.removeprefix('http://')
te=url.removesuffix('com')
print(dele)
print(te)
