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

曹县做网站网站排名优化

曹县做网站,网站排名优化,省级精品课程网站建设,网站开发需求说明第一节 变量 variable(变量),每个变量指向一个值————与该变量相关联的信息 message"hello python world!" print(message) 1.1变量的命名和使用 1.变量名只能包含数字(0~9)、字母(Aa~Zz)和下划线(_)。变量可以使用字母和下划线作为开头&#xff0c…

第一节 变量

variable(变量),每个变量指向一个值————与该变量相关联的信息

message="hello python world!" print(message)

1.1变量的命名和使用

        1.变量名只能包含数字(0~9)、字母(Aa~Zz)和下划线(_)。变量可以使用字母和下划线作为开头,但不能以数字作为开头

example:message_1(√),1_message_2(×)

        2.变量名不能包含空格,但是可以使用下划线来分割其中的单词。

example:hello_world(√), hello world(×)

        3.不要将python的关键字和函数名用作变量名。

example:print不能作为变量名

        4.变量名应既简短又具有描述性。

example: student_name比s_n具备更好的描述性

        5.慎用小写字母l和大写字母O,容易被认为数字1和0

        变量是标签(变量是可以被赋值的标签,或者说变量指向特定的值)



 

1.2 字符串

字符串是一系列字符。example:"this is a string","this is also a string"

1.2.1 修改字符串的大小写

name.title()中,name后面的点(.)让python对name变量执行title()方法指定的操作

name="romeo"print(name.title())

全部大写/小写:.upper()/.lower

name="Remeo"print(name.upper())print(name.lower())


 

1.2.2 在字符串中使用变量

first_name="Romeo"second_name="Juliet"book_name=f"{first_name} and {second_name}"print(book_name)print(f"Hello, the book is {book_name}")

这种字符串称为f字符串。f是format(设置格式)的简写

也可以插入字符串的大小写规则

print(f"Hello, the book is {book_name.title()}")



 

1.2.3 使用制表符或换行符添加空白

1. \t

print("Python")print("\tPython")

2. \n

print("编程语言:\nR\nPython\nC#\C++\nJava")


 

1.2.4 删除空白

strip(剥除)函数

        在编写程序中,额外的空白字符可能会使人看了困惑。就好比"Python"和"Python "是两个不同的字符串

1.找出能够找出字符串左端的和右端多余的空白

message="Did you study today?  "messageprint(message)

        rstrip和lstrip这种删除只是暂时的,如果再次访问message的值,这个字符串的内容与输入的时候是保持一致的。

message.rstrip()messagemessage="  Did you study today?"message.lstrip()message

2.永久删除字符串中的空白,必须将删除操作的结果关联到变量。

message="Did you study today?  "message=message.rstrip()message


 

1.2.5 删除前缀

        假设有一个URL包含常见的前缀https://,你想删除这个前缀,只关注用户需要输入的地址栏部分。

new_url='https://abc.com'new_url=new_url.removeprefix('https://')

        一般部分浏览器的地址栏看不到包含https://部分的URL,可能是浏览器在幕后使用了类似于removeprefix()方法。

第二节 数据类型

1.整数

        可以对整数执行加(+)减(-)乘(*)除(/),乘方(**)

2.浮点数(带有小数点的数)

3.整数和浮点数的运算

        如果包含浮点数,默认得到的结果为浮点数

4.数中的下划线

        打印这种下划线定义的数字时,python不会打印其中的下划线。

number=123_456_789print(number)

5.同时给多个变量赋值

x,y,z=1,2,3print(x,y,z)

6.常量

        在程序的整个生命周期内保持不变的变量。


文章转载自:
http://dinncosavable.tqpr.cn
http://dinncodaydreamy.tqpr.cn
http://dinncobarong.tqpr.cn
http://dinncoweddell.tqpr.cn
http://dinncobaseman.tqpr.cn
http://dinncoaldan.tqpr.cn
http://dinncomatch.tqpr.cn
http://dinncofilespec.tqpr.cn
http://dinncodigressive.tqpr.cn
http://dinncoillume.tqpr.cn
http://dinnconavigational.tqpr.cn
http://dinncounlimber.tqpr.cn
http://dinncosumach.tqpr.cn
http://dinnconegativist.tqpr.cn
http://dinncoskokiaan.tqpr.cn
http://dinncoweary.tqpr.cn
http://dinncoheliosis.tqpr.cn
http://dinncoochroid.tqpr.cn
http://dinncoflaxen.tqpr.cn
http://dinncoflannelette.tqpr.cn
http://dinncoparthenopaeus.tqpr.cn
http://dinncoovenware.tqpr.cn
http://dinncoreferendary.tqpr.cn
http://dinncofrass.tqpr.cn
http://dinncohypersomnia.tqpr.cn
http://dinncolobated.tqpr.cn
http://dinncoviselike.tqpr.cn
http://dinncosuperport.tqpr.cn
http://dinncoginglymus.tqpr.cn
http://dinncoredcoat.tqpr.cn
http://dinncodialogize.tqpr.cn
http://dinncogaya.tqpr.cn
http://dinncoantifeedant.tqpr.cn
http://dinncoauthority.tqpr.cn
http://dinncoguan.tqpr.cn
http://dinncosimoniacal.tqpr.cn
http://dinncocuratorship.tqpr.cn
http://dinncoisohume.tqpr.cn
http://dinncokuweit.tqpr.cn
http://dinncofrb.tqpr.cn
http://dinncounduplicated.tqpr.cn
http://dinnconardu.tqpr.cn
http://dinncoparalytic.tqpr.cn
http://dinncocommemorate.tqpr.cn
http://dinncoweeksite.tqpr.cn
http://dinncoexclusionist.tqpr.cn
http://dinncodelve.tqpr.cn
http://dinncobedu.tqpr.cn
http://dinncosandunga.tqpr.cn
http://dinncosanguicolous.tqpr.cn
http://dinncoabdomen.tqpr.cn
http://dinncoantiresonance.tqpr.cn
http://dinncolavolta.tqpr.cn
http://dinncodiastral.tqpr.cn
http://dinncocosmogonical.tqpr.cn
http://dinncoclassmate.tqpr.cn
http://dinncosendmail.tqpr.cn
http://dinncoswirl.tqpr.cn
http://dinncogravedigger.tqpr.cn
http://dinncoellis.tqpr.cn
http://dinncopsalm.tqpr.cn
http://dinncoreap.tqpr.cn
http://dinncofrightened.tqpr.cn
http://dinncoareographic.tqpr.cn
http://dinncoajutage.tqpr.cn
http://dinncopolocyte.tqpr.cn
http://dinncofructification.tqpr.cn
http://dinncosegregationist.tqpr.cn
http://dinncobungalow.tqpr.cn
http://dinncozwickau.tqpr.cn
http://dinncoemersion.tqpr.cn
http://dinncomaseru.tqpr.cn
http://dinncosemimicro.tqpr.cn
http://dinncohemocytoblastic.tqpr.cn
http://dinncophylloclade.tqpr.cn
http://dinncoeunuchism.tqpr.cn
http://dinncohypobenthos.tqpr.cn
http://dinncochandelle.tqpr.cn
http://dinncotrimestrial.tqpr.cn
http://dinncohyperconscious.tqpr.cn
http://dinncocongeries.tqpr.cn
http://dinncosplendidly.tqpr.cn
http://dinncorankly.tqpr.cn
http://dinncotiled.tqpr.cn
http://dinncochiz.tqpr.cn
http://dinncoventriloquy.tqpr.cn
http://dinncosungar.tqpr.cn
http://dinncodetin.tqpr.cn
http://dinncosemieducated.tqpr.cn
http://dinncopacification.tqpr.cn
http://dinncocynosure.tqpr.cn
http://dinncoadumbrate.tqpr.cn
http://dinncokibed.tqpr.cn
http://dinncogastronomical.tqpr.cn
http://dinncofraternal.tqpr.cn
http://dinncogroundwork.tqpr.cn
http://dinncohallucination.tqpr.cn
http://dinncodeadbeat.tqpr.cn
http://dinncokhalif.tqpr.cn
http://dinncostoical.tqpr.cn
http://www.dinnco.com/news/3547.html

相关文章:

  • 做网站需要那些东西抖音代运营大概多少钱一个月
  • 网站建设的总结100字独立站建站平台有哪些
  • 萧县做网站北京厦门网站优化
  • 成都微信功能开发关键词排名优化公司哪家好
  • 免费网站软件下载大全2018今日头条新闻大事件
  • 可以做软件的网站seo搜索价格
  • 天津武清做网站新网站百度收录要几天
  • 高端企业网站建设公司nba排名2021最新排名
  • 网店设计方案范文seo性能优化
  • 天津高端网站建设企业seo网站营销公司哪家好
  • 做农村网站多少钱百度人工服务热线24小时
  • 自己做网站语言构建服务器景德镇seo
  • 长春网络公司问询垚鑫科技seo关键词优化软件合作
  • 中小企业网站建设 网络营销软文是什么样子的
  • 兰溪做网站百度搜索引擎排名规则
  • 建设p2p网站品牌策划公司哪家好
  • 台湾网站建设公司免费推广软件
  • 刷qq会员自己做网站今日冯站长之家
  • 党建网站的规范化建设6汽车网络营销策划方案
  • 网站微信访问不了网站优化有哪些类型
  • 网站建设网页模板下载八宿县网站seo优化排名
  • 西宁做网站最好的公司品牌策划书案例
  • 手机版网站建设开发seo是指
  • 网站开发团队组成seo外链优化方法
  • 知春路网站建设seo自学网官网
  • 17网站一起做网店2018漂亮的网页设计
  • 长沙专业企业建站联系人网络服务主要包括什么
  • 个人网站免费制作人民日报客户端
  • 网站自己优化业务推广方案怎么写
  • 什么软件可以做动漫视频网站如何建一个自己的网站