当前位置: 首页 > news >正文

asp网站后台密码破解seo综合查询 站长工具

asp网站后台密码破解,seo综合查询 站长工具,温州网站制作的公司,国外网站专题红黄数据容器-----元组 定义格式,特点,相关操作 元组一旦定义,就无法修改 元组内只有一个数据,后面必须加逗号 """ #元组 (1,"hello",True) #定义元组 t1 (1,"hello") t2 () t3 tuple() prin…

数据容器-----元组

定义格式,特点,相关操作

元组一旦定义,就无法修改

元组内只有一个数据,后面必须加逗号

"""
#元组
(1,"hello",True)
#定义元组
t1 = (1,"hello")
t2 = ()
t3 = tuple()
print(f"t1的类型是{type(t1)}")
#单个元素后面需要加逗号
t4 = ("hello",)
print(f"t4的类型是{type(t4)}")
#元素的嵌套
t5 = ((1,2,3),(4,5,6))
print(f"t5的类型是{type(t5),},内容是{t5}")
#下标索引去取内容
element = t5[1][1]
print(element)
#index查找方法
t6 = ("heima","heima","hij","sda")
index = t6.index("hij")
print(f"在元组t6中查找hij,的下标是:{index}")
#元组的操作:count统计方法
num = t6.count("heima")
print(f"在元组t6中,heima的数量是{num}")t8 = ("hins","heima","heima","hij","sda")
num1 = len(t8)
print(f"t8元组中,元素的个数为{num1}")
#while循环
#for 循环遍历
t1 = (1,2,3,4,5,6)
for element in t1:print(f"t1中的元素分别为{element}")t1 = (1,2,3,4,5,6)
index = 0
while index<len(t1):print(f"t1中的元素分别为{t1[index]}")index += 1#元组不支持修改元素
t1 = (1,2,3)
t1[0]=4
print(t1)
"""
#元组内的列表内容可以修改
t2 = (1,2,3,[4,5,6,7])
t2[3][0]=8
print(t2)

t1 = ("周杰伦",11,["football","music"])
index = t1.index("周杰伦")
print(f"周杰伦年龄所在的下标位置是{index}")
name = t1[0]
print(f"该学生的姓名为{name}")
t1[2][0]=()
print(t1)
t1[2][0]="coding"
print(t1)

2.掌握字符串的常见操作

#字符串的替换
#得到的是一个新字符串而并非将原有字符串修改
my_str = "itheima and itcast"
my_str2 = my_str.replace("and","beautiful")
print(my_str2)
print(my_str)

"""
#元组
(1,"hello",True)
#定义元组
t1 = (1,"hello")
t2 = ()
t3 = tuple()
print(f"t1的类型是{type(t1)}")
#单个元素后面需要加逗号
t4 = ("hello",)
print(f"t4的类型是{type(t4)}")
#元素的嵌套
t5 = ((1,2,3),(4,5,6))
print(f"t5的类型是{type(t5),},内容是{t5}")
#下标索引去取内容
element = t5[1][1]
print(element)
#index查找方法
t6 = ("heima","heima","hij","sda")
index = t6.index("hij")
print(f"在元组t6中查找hij,的下标是:{index}")
#元组的操作:count统计方法
num = t6.count("heima")
print(f"在元组t6中,heima的数量是{num}")t8 = ("hins","heima","heima","hij","sda")
num1 = len(t8)
print(f"t8元组中,元素的个数为{num1}")
#while循环
#for 循环遍历
t1 = (1,2,3,4,5,6)
for element in t1:print(f"t1中的元素分别为{element}")t1 = (1,2,3,4,5,6)
index = 0
while index<len(t1):print(f"t1中的元素分别为{t1[index]}")index += 1#元组不支持修改元素
t1 = (1,2,3)
t1[0]=4
print(t1)#元组内的列表内容可以修改
t2 = (1,2,3,[4,5,6,7])
t2[3][0]=8
print(t2)#练习
t1 = ("周杰伦",11,["football","music"])
index = t1.index("周杰伦")
print(f"周杰伦年龄所在的下标位置是{index}")
name = t1[0]
print(f"该学生的姓名为{name}")
t1[2][0]=()
print(t1)
t1[2][0]="coding"
print(t1)my_str = "itheima and itcast"
value = my_str[0]
print(value)
value2 = my_str[-1]
print(value2)
#字符串不支持修改
my_str[0]="1"
print(my_str)#字符串的index方法
my_str = "itheima and itcast"
value = my_str.index("and")
print(f"在字符串中查找and,其起始下标是{value}")#字符串的替换
#得到的是一个新字符串而并非将原有字符串修改
my_str = "itheima and itcast"
my_str2 = my_str.replace("and","beautiful")
print(my_str2)
print(my_str)#字符串的切分
my_str = "itheima and itcast"
mystr2 = my_str.split()
print(my_str)
print(mystr2,f"类型是{type(mystr2)}")#字符串的归整操作(去前后空格)
#不传入参数,去除收尾空格
my_str = "  itheima and itcast  "
newstr = my_str.strip()
print(my_str)
print(newstr)#去除收尾指定元素
my_str = "2314itheima and itcast231"
newstr = my_str.strip("2314")
print(newstr)
#统计元素出现次数
count = my_str.count("i")
print(count)#统计长度
my_str = "2314itheima and itcast231"
length = len(my_str)
print(length)#字符串的遍历
#while
mystr = "lili is a good boy"
index = 0
while index <len(mystr):print(f"该字符串的元素为{mystr[index]}")index += 1#for循环
mystr = "lili is a good boy"
for element in mystr:print(f"该字符串的元素为{element}")
"""

mystr = "itheima itcast boxuegu"
count = mystr.count("it")
print(f"字符串中it一共有{count}个")
newstr = mystr.replace(" ","|")
print(newstr)
new2 = newstr.split("|")
print(new2)
http://www.hkea.cn/news/156972/

相关文章:

  • 网站安全优化域名停靠浏览器
  • 我做中医培训去哪个网站找学员谷歌排名算法
  • 如何将网站让百度收录网店培训班
  • wordpress旧版页面编辑界面百度seo推广计划类型包括
  • 网站建设茶店网网站换友链平台
  • 珠海建设工程信息网站网络营销百度百科
  • 帮别人做网站推广犯法吗关键词排名网站
  • 建设通网站是政府的么高端网站定制设计
  • 玉溪做网站的公司夸克搜索网页版
  • wordpress导航主题haowseo挂机赚钱
  • 广州做家教的网站深圳网络推广招聘
  • 锐捷网络公司排名seo技术介绍
  • 新圩做网站公司拼多多代运营一般多少钱
  • 免费网站可以做cpa?短视频营销的优势
  • b2b外贸营销型网站如何做电商赚钱
  • 建设无障碍网站seo分析报告怎么写
  • 电子商务网站开发进什么科目模板自助建站
  • 威海市住房和城乡建设局官方网站北京seo营销公司
  • 开网页卡优化关键词排名工具
  • wordpress右侧文章归档东莞公司seo优化
  • 个人网站建设需求说明书免费外链生成器
  • 湖南网站建设的公司排名网页制作网站制作
  • 公司网页网站建设 ppt模板app开发公司排行榜
  • 网站开发yuanmus联合早报 即时消息
  • 为什么只有中国人怕疫情seo 页面
  • 网站开发总结报告十大门户网站
  • 临淄信息港发布信息临沂seo建站
  • 门户网站系统介绍企业推广哪个平台好
  • 免费网站建站排行榜网站策划报告
  • 网站设计的评估最近发生的热点新闻