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

网站建设服务公成都网站seo费用

网站建设服务公,成都网站seo费用,建站网站和维护需要会什么,公司变更经营地址需要哪些资料文章目录博主精品专栏导航知识点详解1、input():获取控制台(任意形式)的输入。输出均为字符串类型。1.1、input() 与 list(input()) 的区别、及其相互转换方法2、print() :打印输出。3、整型int() :将指定进制&#xf…

文章目录

  • 博主精品专栏导航
  • 知识点详解
    • 1、input():获取控制台(任意形式)的输入。输出均为字符串类型。
      • 1.1、input() 与 list(input()) 的区别、及其相互转换方法
    • 2、print() :打印输出。
    • 3、整型int() :将指定进制(默认十进制)的字符串或数字转换为十进制整型(强转)。
    •   3.1、bin():十进制整数转换为二进制码。返回值为字符串。
    •   3.2、ord(): ASCII字符转换为十进制整数(Unicode字符 —— Unicode数值)。
    •   3.3、chr():将10进制或16进制数转换为ASCII字符。(Unicode数值 —— Unicode字符)。
    • 4、str.split():通过指定分隔符(默认为空格)对字符串进行切片,并返回分割后的字符串列表(list)。


博主精品专栏导航

  • 🍕  【Pytorch项目实战目录】算法详解 + 项目详解 + 数据集 + 完整源码
  • 🍔 【sklearn】线性回归、最小二乘法、岭回归、Lasso回归
  • 🥘 三万字硬核详解:yolov1、yolov2、yolov3、yolov4、yolov5、yolov7
  • 🍰 卷积神经网络CNN的发展史
  • 🍟 卷积神经网络CNN的实战知识
  • 🍝 Pytorch基础(全)
  • 🌭 Opencv图像处理(全)
  • 🥙 Python常用内置函数(全)

描述

把m个同样的苹果放在n个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?
注意:如果有7个苹果和3个盘子,(5,1,1)和(1,5,1)被视为是同一种分法。

数据范围:0 ≤ m ≤ 10 ,1 ≤ n ≤ 10 。

输入描述:输入两个int整数

输出描述:输出结果,int型


示例1

输入:7 3输出:8

Python3

def main(m,n):if m == 0 or n == 1:return 1elif m < n:return main(m,m)else:return (main(m, n-1) + main(m-n, n))while True:try:mn = input().split(" ")m = int(mn[0])n = int(mn[1])print(main(m,n))except:break

知识点详解

1、input():获取控制台(任意形式)的输入。输出均为字符串类型。

str1 = input()
print(str1)
print('提示语句:', str1)
print(type(str1))'''
asd123!#
提示语句: asd123!#
<class 'str'>
'''
常用的强转类型说明
int(input())强转为整型(输入必须时整型)
list(input())强转为列表(输入可以是任意类型)

1.1、input() 与 list(input()) 的区别、及其相互转换方法

  • 相同点:两个方法都可以进行for循环迭代提取字符,提取后都为字符串类型。
  • 不同点str = list(input()) 将输入字符串转换为list类型,可以进行相关操作。如: str.append()
  • 将列表转换为字符串:str_list = ['A', 'aA', 2.0, '', 1]
  • 方法一:print(''.join(str))
  • 方法二:print(''.join(map(str, str_list)))

备注:若list中包含数字,则不能直接转化成字符串,否则系统报错。

  • 方法一:print(''.join([str(ii) for ii in str_list]))
  • 方法二:print(''.join(map(str, str_list)))
    map():根据给定函数对指定序列进行映射。即把传入函数依次作用到序列的每一个元素,并返回新的序列。

(1) 举例说明:若list中包含数字,则不能直接转化成字符串,否则系统报错。

str = ['25', 'd', 19, 10]
print(' '.join(str))'''
Traceback (most recent call last):File "C:/Users/Administrator/Desktop/test.py", line 188, in <module>print(' '.join(str))
TypeError: sequence item 3: expected str instance, int found
'''

(2)举例说明:若list中包含数字,将list中的所有元素转换为字符串。

str_list = ['A', 'aA', 2.0, '', 1]
print(''.join(str(ii) for ii in str_list))
print(''.join([str(ii) for ii in str_list]))
print(''.join(map(str, str_list))) 		# map():根据给定函数对指定序列进行映射。即把传入函数依次作用到序列的每一个元素,并返回新的序列。'''
AaA2.01
AaA2.01
AaA2.01
'''

2、print() :打印输出。

【Python】print()函数的用法

x, y = 1, 9
print('{},{}' .format(x, y))	# 打印方法一
print('*'*10)					# 打印分割符
print(x, ',', y)				# 打印方法二'''
1,9
**********
1 , 9
'''

3、整型int() :将指定进制(默认十进制)的字符串或数字转换为十进制整型(强转)。

  • Python2 有 long int 类型,而Python3 整型没有范围限制,故可以当作 long int 使用。
  • 布尔类型 bool 是整型的子类型,包括两种:True == 1、False == 0

函数说明:int(x, base=10)
输入参数:

  • x:字符串或数字(整数、浮点数)。
  • base默认十进制
    备注1:若带参数base,表示将 (二进制、十进制、十六进制)的 x 转换为十进制。
    备注2:若带参数base,则输入必须是整数,且整数必须以字符串的形式进行输入。
输入返回值举例输出
int('整数', base=16)输入整数指定为16进制,转换为10进制整数(同理:其余进制)print(int('20', 16))print(int('0XAA', 16))32 和 170
(1)输入为空或整数\\\
int()\print(int())0
int(浮点数)\print(int(-2.1))-2
(2)输入为字符串\\\
int(字符串)\print(int('-2'))-2
int(字符串(浮点数))需先将str转换为float,再转换为int,否则报错。print(int(float('-2.1')))-2

十进制转换为16进制

十六进制范围:0 ~ 65536(0000 ~ FFFF)
方法:

  • (1)十进制数除16(取余数1),得商1
  • (2)商1除16(取余数2),得商2
  • (3)商2除16(取余数3),得商3
  • (4)最后商3等于0(取余数4)
  • 最终结果为倒序余数= [余数4, 余数3, 余数2, 余数1]

举例(整数:65036)
(1)65036 除 16,商4064,余数 12(十六进制C)
(2)4064 除 16,商254,余数 0(十六进制0)
(3)254 除 16,商15,余数 14(十六进制E)
(4)15除16,商0,余数 15(十六进制F)。
(5)结束:得16进制为 = FE0C

十进制0123456789101112131415
16进制0123456789ABCDEF
2进制0000000100100011010001010110011110001001101010111100110111101111

  3.1、bin():十进制整数转换为二进制码。返回值为字符串。

函数说明:bin(整型)

print(bin(-3))
print(type(bin(-3)))'''
-0b11
<class 'str'>
'''

  3.2、ord(): ASCII字符转换为十进制整数(Unicode字符 —— Unicode数值)。

函数说明:ord(字符)

print(ord('A'))
print(type(ord('A')))'''
65
<class 'int'>
'''

  3.3、chr():将10进制或16进制数转换为ASCII字符。(Unicode数值 —— Unicode字符)。

函数说明:chr(number)

print(chr(97))
print(type(chr(97)))'''
a
<class 'str'>
'''

4、str.split():通过指定分隔符(默认为空格)对字符串进行切片,并返回分割后的字符串列表(list)。

函数说明:str.split(str=".", num=string.count(str))[n]
参数说明:

  • str: 表示分隔符,默认为空格,但是不能为空。若字符串中没有分隔符,则把整个字符串作为列表的一个元素。
  • num:表示分割次数。如果存在参数num,则仅分隔成 num+1 个子字符串,并且每一个子字符串可以赋给新的变量。
  • [n]: 表示选取第n个切片。
    • 注意:当使用空格作为分隔符时,对于中间为空的项会自动忽略。
s = 'www.dod.com.cn'
print('分隔符(默认): ', s.split())                    # 【输出结果】分隔符(默认):  ['www.dod.com.cn']
print('分隔符(.): ', s.split('.'))                   # 【输出结果】分隔符(.):  ['www', 'dod', 'com', 'cn']
print('分割1次, 分隔符(.): ', s.split('.', 1))        # 【输出结果】分割1次, 分隔符(.):  ['www', 'dod.com.cn']
print('分割2次, 分隔符(.): ', s.split('.', 2))        # 【输出结果】分割2次, 分隔符(.):  ['www', 'dod', 'com.cn']
print('分割2次, 分隔符(.), 取出分割后下标为1的字符串: ', s.split('.', 2)[1])      # 【输出结果】分割2次, 分隔符(.), 取出分割后下标为1的字符串:  dod
print(s.split('.', -1))                             # 【输出结果】['www', 'dod', 'com', 'cn']
###########################################
# 分割2次, 并分别保存到三个变量
s1, s2, s3 = s.split('.', 2)
print('s1:', s1)                                    # 【输出结果】s1: www
print('s2:', s1)                                    # 【输出结果】s2: www
print('s3:', s2)                                    # 【输出结果】s3: dod
###########################################
# 连续多次分割
a = 'Hello<[www.dodo.com.cn]>Bye'
print(a.split('['))                                 # 【输出结果】['Hello<', 'www.dodo.com.cn]>Bye']
print(a.split('[')[1].split(']')[0])                # 【输出结果】www.dodo.com.cn
print(a.split('[')[1].split(']')[0].split('.'))     # 【输出结果】['www', 'dodo', 'com', 'cn']

文章转载自:
http://ribgrass.hwbf.cn
http://lassa.hwbf.cn
http://disobedience.hwbf.cn
http://clink.hwbf.cn
http://ichthyoacanthotoxism.hwbf.cn
http://provisionality.hwbf.cn
http://viraemia.hwbf.cn
http://intoed.hwbf.cn
http://paramount.hwbf.cn
http://macrencephaly.hwbf.cn
http://odyl.hwbf.cn
http://snuffers.hwbf.cn
http://rated.hwbf.cn
http://quizzer.hwbf.cn
http://infield.hwbf.cn
http://excarnation.hwbf.cn
http://statesmanlike.hwbf.cn
http://vasodilating.hwbf.cn
http://fallal.hwbf.cn
http://mammalogy.hwbf.cn
http://polygyny.hwbf.cn
http://crud.hwbf.cn
http://fulminant.hwbf.cn
http://seniti.hwbf.cn
http://semiofficially.hwbf.cn
http://linin.hwbf.cn
http://cavortings.hwbf.cn
http://disarmament.hwbf.cn
http://racemize.hwbf.cn
http://african.hwbf.cn
http://splint.hwbf.cn
http://aberdevine.hwbf.cn
http://crow.hwbf.cn
http://sulphatase.hwbf.cn
http://soubise.hwbf.cn
http://skibobbing.hwbf.cn
http://harquebuss.hwbf.cn
http://ninepence.hwbf.cn
http://soldierlike.hwbf.cn
http://autosave.hwbf.cn
http://wigmaker.hwbf.cn
http://supercarrier.hwbf.cn
http://inoculation.hwbf.cn
http://nyassa.hwbf.cn
http://savaii.hwbf.cn
http://grippe.hwbf.cn
http://crmp.hwbf.cn
http://unsolved.hwbf.cn
http://sergeantship.hwbf.cn
http://misjudgement.hwbf.cn
http://scattering.hwbf.cn
http://alexipharmic.hwbf.cn
http://reit.hwbf.cn
http://dpi.hwbf.cn
http://calorifacient.hwbf.cn
http://torchlight.hwbf.cn
http://adrenocorticosteroid.hwbf.cn
http://lamed.hwbf.cn
http://permit.hwbf.cn
http://adherence.hwbf.cn
http://frazil.hwbf.cn
http://circummure.hwbf.cn
http://whitaker.hwbf.cn
http://cycloheximide.hwbf.cn
http://shipman.hwbf.cn
http://airdash.hwbf.cn
http://kniferest.hwbf.cn
http://explicans.hwbf.cn
http://stipe.hwbf.cn
http://chroma.hwbf.cn
http://hafnium.hwbf.cn
http://yardage.hwbf.cn
http://fist.hwbf.cn
http://debridement.hwbf.cn
http://minicrystal.hwbf.cn
http://lidded.hwbf.cn
http://recruiter.hwbf.cn
http://approximation.hwbf.cn
http://prejudice.hwbf.cn
http://insensibly.hwbf.cn
http://tenent.hwbf.cn
http://negrophobe.hwbf.cn
http://histology.hwbf.cn
http://compression.hwbf.cn
http://onstage.hwbf.cn
http://caddoan.hwbf.cn
http://unwearable.hwbf.cn
http://coaly.hwbf.cn
http://restively.hwbf.cn
http://drowning.hwbf.cn
http://gaol.hwbf.cn
http://satori.hwbf.cn
http://turbellarian.hwbf.cn
http://friendship.hwbf.cn
http://orville.hwbf.cn
http://imagic.hwbf.cn
http://watering.hwbf.cn
http://jibboom.hwbf.cn
http://outclass.hwbf.cn
http://uniflorous.hwbf.cn
http://www.15wanjia.com/news/70748.html

相关文章:

  • 辽宁大连直客部七部seo排名快速上升
  • 个人怎么做旅游网站如何进行网络营销推广
  • 西安做搭建网站免费外贸接单平台
  • 网站设计建设合同是无锡网站排名公司
  • 保健品网站可以做网站福州搜索引擎优化公司
  • 武汉站设计单位百度ai人工智能平台
  • 长春专业做网站百度电脑版官网下载
  • 在线相册jsp网站开发与设计千牛怎么做免费推广引流
  • 部门网站建设的意义搜索引擎优化的七个步骤
  • 网站颜色 字体员工培训
  • 北京网站设计 培训seo关键词排名优化
  • 想搞一个自己的网站怎么做营销策划书模板
  • 青岛高品质网站建设网页游戏
  • 在网站制作前需要有哪些前期策划工作seo长沙
  • 装修招标网站最近军事新闻热点大事件
  • 在美国做垂直网站有哪些网络营销服务外包
  • 企业型网站制作百度seo关键词排名优化教程
  • 做网站横幅的软件推广赚钱的项目
  • 手机微网站开发国内最近的新闻大事
  • 一个二手书网站的建设目标最近新闻内容
  • 政府网站架构工具全网营销系统怎么样
  • 曰本真人做爰免费网站举三个成功的新媒体营销案例
  • 简单做网站需要学什么软件东莞网站推广技巧
  • 少儿编程加盟哪个机构好抖音seo排名软件
  • 重庆开县网站建设公司推荐巨量算数官方入口
  • 广州网站建设设计哪家好百度收录站长工具
  • wordpress同步到公众平台满足seo需求的网站
  • 可以做砍价活动的网站外贸网站制作推广
  • 普通网站做网址收录入口
  • 白云区最新疫情重庆网站搜索引擎seo