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

电商网站怎样优化seo的外链平台有哪些

电商网站怎样优化,seo的外链平台有哪些,wordpress 多个主题,网盟推广与信息流流程控制 顺序结构、条件结构、循环结构,顺序结构由自上而下的语句构成,条件结构由if、match-case构成,循环结构由for、while构成。 if语句 flag 1 if flag 1:print("A") elif flag 2:print("B") else:print("…

流程控制

顺序结构、条件结构、循环结构,顺序结构由自上而下的语句构成,条件结构由ifmatch-case构成,循环结构由forwhile构成。

if语句

flag = 1
if flag == 1:print("A")
elif flag == 2:print("B")
else:print("C")

match-case语句

结构模式匹配,Python3.10引入

PEP 634 – Structural Pattern Matching: Specification

PEP 635 – Structural Pattern Matching: Motivation and Rationale

PEP 636 – Structural Pattern Matching: Tutorial

# literal pattern
def structural_pattern_matching(value):match value:case 1:print("A")case "2":print("B")case True:print("C")case False:print("D")case None:print("E")structural_pattern_matching(1)
structural_pattern_matching("2")
structural_pattern_matching(None)
structural_pattern_matching("ABC")
# capture pattern
# guard是case的一部分,为if语句def structural_pattern_matching(value):match value:case {'sub': sub, **rest}:print(f'{sub=} {rest=}')case {'route': route}:print(f'ROUTE: {route}')structural_pattern_matching({'route': '/auth/login'})
structural_pattern_matching({'route': '/auth/login', 'sub': {'a': 1}})def go(obj):match obj:case 'go', [direction, num] if isinstance(num, int):print(f"go {direction} {num}")case 'stop', *other:print('stop', *other)go(['go', ['east', 3]])
go(['go', ['east', "3"]])
go(['stop', '3', '2', '1'])
# as pattern
def structural_pattern_matching(value):match value:case ["go", ("north" | "south" | "east" | "west") as direction]:print(f'go {direction}')case _:print("B")structural_pattern_matching(['go', 'west'])
# or pattern
def structural_pattern_matching(value):match value:case 0 | 1 | 2:print('A')case True | False:print('B')structural_pattern_matching(1)
# wildcard pattern
# 通配符,匹配任意值,通配符匹配必须要在最后
# SyntaxError: wildcard makes remaining patterns unreachable
def structural_pattern_matching(value):match value:case 1:print("A")case _:print("B")structural_pattern_matching(1)
structural_pattern_matching("2")
# Matching builtin classes
# 可以按类型匹配
def structural_pattern_matching(obj):match obj:case str() as s:print(s)case [0, tuple() as t]:print(f'{t}')case list() as l:print(l)structural_pattern_matching("ooo")  # ooo
structural_pattern_matching([0, (1,)])  # (1,)
structural_pattern_matching([(1,)])  # [(1,)]
structural_pattern_matching([1, 2, 3])  # [1, 2, 3]
# Matching positional attributes
from dataclasses import dataclassclass Point1:__match_args__ = ('x', 'y')def __init__(self, x, y):self.x = xself.y = y@dataclass
class Point2:x: inty: intdef structural_pattern_matching(value):match value:case Point1(x, y):print(f'{x=}, {y=}')case Point2(x, y):print(f'{x=}, {y=}')structural_pattern_matching(Point1(1, 2))
structural_pattern_matching(Point2(3, 4))

for语句

for i in range(10):print(i)
else:print("break跳出不执行else")

while语句

count = 10
while count:count -= 1print(count)# break# continue
else:print("循环正常执行完毕,没有被break打断")
http://www.mmbaike.com/news/67420.html

相关文章:

  • 聊城专业建wap网站临沧seo
  • 做班级网站的素材淘宝seo优化怎么做
  • wordpress微信登陆插件下载青海seo技术培训
  • 有什么做的好的ppt排版网站竞价推广账户托管服务
  • 企业网站的类型吴中seo页面优化推广
  • 夹克定制公司seo资讯网
  • 网站建设评判北京网站推广排名
  • myeclipse网站开发论坛买外链有用吗
  • 做网站建设的平台软文写作是什么
  • 网站建设存在的具体问题个人网页免费域名注册入口
  • 网站建设咨询问卷制作网页用什么软件
  • 云营销网站建设电话咨询怎样进行seo
  • 一个正规的网站建设公司网站优化推广
  • 汉口网站制作设计企业微信会话存档
  • url主域名和注册网站不一致怎么做链接推广产品
  • wordpress 其他数据库关键词seo深圳
  • wordpress会员功能主题深圳纯手工seo
  • 企业内部网站源码写手代写平台
  • 太原网站建设公司seo营销策划
  • 装饰公司师大排名网站seo李守洪排名大师
  • 石家庄微网站建设公司哪家好sem优化师是做什么的
  • 网站开发网外链生成
  • 马云之前做的网站四川省最新疫情情况
  • 做宣传网站买什么云服务器网络广告的计费方式
  • 沧州地区阿里巴巴做网站提交百度收录
  • 动态网站开发有哪些技术seo是干啥的
  • PHP+MySQL网站开发全程实例最新的全国疫情数据
  • 电子商务网站设计毕业设计论文天津优化公司
  • 公安网站开发功能介绍app拉新
  • 网页设计教程 表单百度推广怎么优化关键词的质量