1.字符串的基本使用
# 定义一个字符串 str1, 字符串的内容为 "hello world and itcast and itheima and Python"
str1 = "hello world and itcast and itheima and Python"
# 在字符串str1中查找 字符串 and 的下标
num = str1.find('and')
print(num) # 12
# 在字符串str1中查找字符串 'good'的下标
num1 = str1.find('good')
print(num1) # -1
# 将字符串str1中的 and 替换为 or
str2 = str1.replace("and", "or")
print(str2) # hello world or itcast or itheima or Python
# 将字符串 str1 按照 空白字符进行切割,保存到变量 list1 中
list1 = str1.split()
print(list1) # ['hello', 'world', 'and', 'itcast', 'and', 'itheima', 'and', 'Python']
# 使用 _*_ 将 list1中的字符串进行连接
str3 = "_*_".join(list1)
print(str3) # hello_*_world_*_and_*_itcast_*_and_*_itheima_*_and_*_Python
# 使用 逗号 将 list1中的字符串进行连接
str4 = ",".join(list1)
print(str4) # hello,world,and,itcast,and,itheima,and,Python

2.列表的基本使用
# 2.练习对列表的增删改查统计的操作,具体操作如下:
# 1)声明一个列表,包含的数据有:["hello", "python", "itcast", "hello&