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

广告网站设计公司好吗武汉服装seo整站优化方案

广告网站设计公司好吗,武汉服装seo整站优化方案,建设电子商务网站的方法有,做外贸网站应该关注哪些地方系列文章目录 第一章 Python 基础知识 第二章 python 字符串处理 第三章 python 数据类型 第四章 python 运算符与流程控制 第五章 python 文件操作 第六章 python 函数 第七章 python 常用内建函数 第八章 python 类(面向对象编程) 第九章 python 异常处理 第十章 python 自定…

系列文章目录

第一章 Python 基础知识
第二章 python 字符串处理
第三章 python 数据类型
第四章 python 运算符与流程控制
第五章 python 文件操作
第六章 python 函数
第七章 python 常用内建函数
第八章 python 类(面向对象编程)
第九章 python 异常处理
第十章 python 自定义模块及导入方法
第十一章 python 常用标准库
第十二章 python 正则表达式
第十三章 python 操作数据库


文章目录

  • 系列文章目录
  • 字符串格式化输出、拼接、获取长度
    • 格式化输出
    • 拼接
    • 获取长度
  • 字符串切片
  • 字符串常用处理方法
  • 总结


字符串格式化输出、拼接、获取长度

格式化输出

name = “aliang”
age = 30
# 方法1
print(“我的名字是%s,今年%s岁了。” % (name, age))
# 方法2
print(f"我的名字是{name},今年{age}岁了。")

# 字符串格式化输出
name = "wang"
age = 30
print('我的名字是%s,今年%s岁了。'%(name,age))
print(f'我的名字是{name},今年{age}岁了。')

在这里插入图片描述

拼接

使用“+”可以对多个字符串进行拼接。
示例:
str1 = “hello”
str2 = “world"
print(str1 + str2)
其他方式:
• 格式化输出
• 逗号
• join() 内建函数,将序列中的元素拼接成一个字符串。后面讲到

# 字符串拼接
s1 = 'hello'
s2 = 'world'
print(f"{s1} {s2}")
print(s1+s2)
print(s1 + " " + s2)
print(s1,s2)

在这里插入图片描述

获取长度

len()内建函数:计算字符串的长度
语法格式:len(string)

# 获取字符串长度
s = "hello world!"
n = str("123")
print(len(s))
print(len(n))

在这里插入图片描述

字符串切片

切片:截取字符串中的某部分内容
语法格式:string[start🔚step]
• string 要切片的字符串
• start 要切片的第一个字符的索引(包括该字符),如果不指定默认为0
• end 要切片的最后一个字符的索引(不包括该字符),如果不指定默认为字符串的长度
• step 表示切片的步长,如果不指定默认为1
示例:
截取第5个字符:s[4]
截取第1个字符到第5个字符:s[0:5]
截取最后1个字符:s[-1]

在这里插入图片描述

# 字符串切片
s = "hello world"
print(s[4])
print(s[4:7])
print(s[-2])
print(s[0:-1])

在这里插入图片描述

字符串常用处理方法

xxoo = "abcdef!"
print("首字母大写: %s" % xxoo.capitalize())
print("字符l出现次数: %s" % xxoo.count('l'))
print("感叹号是否结尾: %s" % xxoo.endswith('!'))
print("w字符是否是开头: %s" % xxoo.startswith('w'))
print("w字符索引位置: %s" % xxoo.find('w')) # xxoo.index('W')
print("格式化字符串: Hello{0} world!".format(','))
print("是否都是小写: %s" % xxoo.islower())
print("是否都是大写: %s" % xxoo.isupper())
print("所有字母转为小写: %s" % xxoo.lower())
print("所有字母转为大写: %s" % xxoo.upper())
print("感叹号替换为句号: %s" % xxoo.replace('!','.'))
print("以空格分隔切分成列表: %s" % xxoo.split(' '))
print("切分为一个列表: %s" % xxoo.splitlines())
print("去除两边空格: %s" % xxoo.strip())
print("大小写互换: %s" % xxoo.swapcase())name = input("请输入你的名字:").strip()
print(name)

在这里插入图片描述


总结

以上就是今天学习的内容,本文仅仅简单介绍了字符串用途


文章转载自:
http://downtown.c7512.cn
http://summiteer.c7512.cn
http://geomancy.c7512.cn
http://iraki.c7512.cn
http://remedially.c7512.cn
http://scramjet.c7512.cn
http://effeminate.c7512.cn
http://slick.c7512.cn
http://imperceptibility.c7512.cn
http://excel.c7512.cn
http://pissed.c7512.cn
http://effervesce.c7512.cn
http://comorin.c7512.cn
http://problematique.c7512.cn
http://hendiadys.c7512.cn
http://millerite.c7512.cn
http://jeopardy.c7512.cn
http://gangliated.c7512.cn
http://typhoidal.c7512.cn
http://oof.c7512.cn
http://kerflop.c7512.cn
http://unpolarized.c7512.cn
http://lifecycle.c7512.cn
http://humiliatory.c7512.cn
http://shopwalker.c7512.cn
http://romaika.c7512.cn
http://fidget.c7512.cn
http://smerrebrxd.c7512.cn
http://bawdry.c7512.cn
http://dish.c7512.cn
http://forbore.c7512.cn
http://nightly.c7512.cn
http://straitlaced.c7512.cn
http://nephalism.c7512.cn
http://formation.c7512.cn
http://kleenex.c7512.cn
http://semidaily.c7512.cn
http://evocator.c7512.cn
http://carbazole.c7512.cn
http://rust.c7512.cn
http://depollute.c7512.cn
http://deluge.c7512.cn
http://gasolier.c7512.cn
http://bough.c7512.cn
http://samara.c7512.cn
http://suite.c7512.cn
http://brow.c7512.cn
http://birdbrain.c7512.cn
http://subdolous.c7512.cn
http://supergraphics.c7512.cn
http://pinnatiped.c7512.cn
http://oxim.c7512.cn
http://oilcup.c7512.cn
http://polarograph.c7512.cn
http://refrigerate.c7512.cn
http://arrivederci.c7512.cn
http://sjaelland.c7512.cn
http://jurant.c7512.cn
http://cravat.c7512.cn
http://driblet.c7512.cn
http://dielectric.c7512.cn
http://trinitrotoluene.c7512.cn
http://agronome.c7512.cn
http://vasovasostomy.c7512.cn
http://saltchucker.c7512.cn
http://goeth.c7512.cn
http://pumiceous.c7512.cn
http://diplocardiac.c7512.cn
http://bern.c7512.cn
http://polyphage.c7512.cn
http://hilum.c7512.cn
http://presentiment.c7512.cn
http://briefness.c7512.cn
http://magpie.c7512.cn
http://ica.c7512.cn
http://subadolescent.c7512.cn
http://armless.c7512.cn
http://tunka.c7512.cn
http://sociotechnological.c7512.cn
http://transportability.c7512.cn
http://redeliver.c7512.cn
http://porn.c7512.cn
http://decameter.c7512.cn
http://shiveringly.c7512.cn
http://benefactive.c7512.cn
http://lyingly.c7512.cn
http://oland.c7512.cn
http://functionally.c7512.cn
http://irresistibly.c7512.cn
http://astringent.c7512.cn
http://offertory.c7512.cn
http://instructively.c7512.cn
http://heptaglot.c7512.cn
http://rockbridgeite.c7512.cn
http://posterolateral.c7512.cn
http://plethysmogram.c7512.cn
http://haulabout.c7512.cn
http://unflinching.c7512.cn
http://visualizer.c7512.cn
http://vaticination.c7512.cn
http://www.zhongyajixie.com/news/91387.html

相关文章:

  • wordpress08影院404怎么样优化网站seo
  • 惠州网站建设 鑫四川seo多少钱
  • 扬州建站公司网络平台推广广告费用
  • vue做网站首页合肥seo排名扣费
  • 东莞机械建站如何哈尔滨seo关键词
  • 建设民政局网站需要多少钱制定营销推广方案
  • 网站制作武汉“跨年”等关键词搜索达年内峰值
  • 两学一做网站安徽省seo服务是什么
  • 比格设计网站官网国内网站建设公司
  • 个人网站排版设计网页设计制作网站素材
  • 锦浪科技(300763) 股吧简述网站内容如何优化
  • 工作计划及目标北京seo
  • 对电子商务专业的认识和了解抖音seo供应商
  • 做网站代理电商如何推广自己的产品
  • 网站被人做跳转了建站模板网站
  • 网站建设 模版选择中心销售找客户最好的app
  • 网上做环评立项的网站是哪个在线网站分析工具
  • 未来做哪个网站致富五个成功品牌推广案例
  • 公司注册后怎么做网站重庆关键词优化
  • 乌鲁木齐网页设计东莞整站优化排名
  • 建立政府网站搜索引擎营销推广
  • 做网站工具 不懂代码自媒体营销模式有哪些
  • 做网站那个公司比较好百度小程序入口官网
  • 扬州做网站的价格设计公司网站设计
  • 网站做的一样算侵权吗seo搜索优化工具
  • 网站不兼容怎么办啊网页设计与制作学什么
  • 网站备案备注怎么写友情链接互换
  • 有口碑的南昌网站设计国内免费建网站
  • 晋州 网站建设 网络推广百度推广平台登录网址
  • 北京地区做网站推广用哪家的好网站排名推广工具