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

大型公司网站制作谷歌搜索网址

大型公司网站制作,谷歌搜索网址,wordpress布局模板,wordpress google统计Python--快速入门二 1.Python数据类型 1.可以通过索引获取字符串中特定位置的字符: a "Hello" print(a[3]) 2.len函数获取字符串的长度: a "Hello" print(a) print(len(a)) 3.空值类型表示完全没有值: 若不确定当…

Python--快速入门二

1.Python数据类型

1.可以通过索引获取字符串中特定位置的字符:

a = "Hello"
print(a[3])

 

2.len函数获取字符串的长度: 

a = "Hello"
print(a)
print(len(a))

 

3.空值类型表示完全没有值:

若不确定当前变量的值,可以先使用None赋值

 eg:

a = None
print(a)

4.可以用type函数返回当前数据的类型

a = "Hello"
b = 10
c = 10.5
d = True       #True和False均需要大写开头
e = None       #None需要大写开头
print(type(a))
print(type(b))
print(type(c))
print(type(d))
print(type(e))

2.Python交互模式

打开方法:

Pycharm中打开Python控制台即可进入交互模式

Windows打开cmd输入python也可以进入交互模式

交互模式的作用:

1.python会直接执行当前输入的代码

2. 可以不用print语句,直接输出变量中的值

3.算术运算可以直接输出结果

eg:

 3.Python的input指令

使用语法:

input()的括号中用引号框住给用户输入的提示,同时该函数返回一个字符串值。

user_height = input("请输入您的身高(/m):")
print(user_height + "m1.75")

 

eg:BMI指数计算器

# BMI = 体重 / (身高**2)# 输入身高
user_height = input("请输入您的身高(/m):")
# 输入体重
user_weight = input("请输入您的体重(/kg):")print("用户的身高:" + user_height + "m")
print("用户的体重:" + user_weight + "kg")# 此时user_height和user_weight两个变量储存的值均为字符串,用于计算则需要通过相应的int()或float()函数进行数值转换
user_BMI = float(user_weight) / (float(user_height)**2)# 字符串和浮点数不能同时输出,通过str将浮点数转换为字符串再进行print操作
print("用户的BMI:" + str(user_BMI))

 

4.Python条件语句

1.if,else后的条件语句分别为条件为真和条件为假时的执行语句

2.执行语句前需要有缩进,一般为四个空格(python通过缩进判断该执行语句是否属于该条件语句,并且是属于if或是else)

代码展示:

test_grade = input("请输入您的成绩:")# 此时输入的成绩是字符串,需要转换为整型
if int(test_grade) >= 60:print("恭喜您此次考试及格了")
else:print("很遗憾您挂科了")

5.Python嵌套/多条件判断

1.对于elif多条件判断,如果同时满足条件二和条件三,则Python会执行条件二下的语句B,因为Python是至上而下进行语句的执行的。

代码展示:

test_grade = input("请输入您的成绩:")# 此时输入的成绩是字符串,需要转换为整型
if int(test_grade) >= 60:print("恭喜您此次考试及格了")if int(test_grade) >= 90:print("您此时的成绩为优秀")
else:print("很遗憾您挂科了")

test_grade = input("请输入您的成绩:")if int(test_grade)<60:print("很遗憾您挂科了")
# 对于 int(test_grade) > 90 的判断需要放在>60的前面,要不然则不会执行对应的语句
elif int(test_grade) > 90:print("您此次考试的成绩为优秀")
elif int(test_grade)>60:print("恭喜您通过了此次考试")
else:print("unknown")

6.Python逻辑运算

Python的逻辑运算符有三个:

1.and和or都可以对多个操作对象进行运算:A and B /   C or D

2.not只能对一个操作对象进行运算:not E

3.逻辑运算符的运算具有优先级:not > and > or

代码展示:

test_grade = int(input("请输入您的成绩:"))if test_grade > 60 and test_grade >= 90:print("您的成绩为优秀")
elif test_grade > 60 and test_grade < 90:print("恭喜您的成绩及格了")
elif not(test_grade > 0):print("您的成绩输入有误")


文章转载自:
http://dinncopedimental.bpmz.cn
http://dinncoprepose.bpmz.cn
http://dinncoschema.bpmz.cn
http://dinncoburyat.bpmz.cn
http://dinncoearless.bpmz.cn
http://dinncoyesty.bpmz.cn
http://dinncoorthoepist.bpmz.cn
http://dinncomotordrome.bpmz.cn
http://dinncothievish.bpmz.cn
http://dinncookeh.bpmz.cn
http://dinncoexudative.bpmz.cn
http://dinncoforgetter.bpmz.cn
http://dinncobgc.bpmz.cn
http://dinncocalceate.bpmz.cn
http://dinncomonitor.bpmz.cn
http://dinnconoetic.bpmz.cn
http://dinncopneumonic.bpmz.cn
http://dinncoesker.bpmz.cn
http://dinncosestertia.bpmz.cn
http://dinncopapermaking.bpmz.cn
http://dinncoostensibly.bpmz.cn
http://dinncobonzer.bpmz.cn
http://dinncobawdily.bpmz.cn
http://dinncobrassy.bpmz.cn
http://dinncoprinted.bpmz.cn
http://dinncochromatogram.bpmz.cn
http://dinncobrickkiln.bpmz.cn
http://dinncoglamorgan.bpmz.cn
http://dinncohemocoele.bpmz.cn
http://dinncomicrodensitometer.bpmz.cn
http://dinncoclothier.bpmz.cn
http://dinncokidnapee.bpmz.cn
http://dinncodiving.bpmz.cn
http://dinncoaircrewman.bpmz.cn
http://dinncotemporarily.bpmz.cn
http://dinnconamable.bpmz.cn
http://dinncospiciform.bpmz.cn
http://dinncotushery.bpmz.cn
http://dinncomammogenic.bpmz.cn
http://dinncounweakened.bpmz.cn
http://dinncosenegal.bpmz.cn
http://dinncoappeal.bpmz.cn
http://dinncopreservation.bpmz.cn
http://dinncoramazan.bpmz.cn
http://dinncosmb.bpmz.cn
http://dinncodecelerate.bpmz.cn
http://dinncoexquisite.bpmz.cn
http://dinncosaintfoin.bpmz.cn
http://dinncowhew.bpmz.cn
http://dinncocirrocumulus.bpmz.cn
http://dinncounredeemable.bpmz.cn
http://dinncokatatonia.bpmz.cn
http://dinncoliquefacient.bpmz.cn
http://dinncotalkative.bpmz.cn
http://dinncowristlet.bpmz.cn
http://dinncojove.bpmz.cn
http://dinncoquarterfinal.bpmz.cn
http://dinncobbl.bpmz.cn
http://dinncofidate.bpmz.cn
http://dinncorailcar.bpmz.cn
http://dinncoileac.bpmz.cn
http://dinncoophiolater.bpmz.cn
http://dinncoreanimation.bpmz.cn
http://dinncopyrogallate.bpmz.cn
http://dinncotrauma.bpmz.cn
http://dinncotaborin.bpmz.cn
http://dinncorosenthal.bpmz.cn
http://dinncoconicity.bpmz.cn
http://dinncoellipticity.bpmz.cn
http://dinncovaccy.bpmz.cn
http://dinncoahwaz.bpmz.cn
http://dinncoscience.bpmz.cn
http://dinncoskeeler.bpmz.cn
http://dinncohorsing.bpmz.cn
http://dinncopolitesse.bpmz.cn
http://dinncoultraism.bpmz.cn
http://dinncovioloncello.bpmz.cn
http://dinncolabware.bpmz.cn
http://dinncoarmed.bpmz.cn
http://dinncoaficionada.bpmz.cn
http://dinncohumidification.bpmz.cn
http://dinncolvn.bpmz.cn
http://dinncopeacetime.bpmz.cn
http://dinncoquadro.bpmz.cn
http://dinncodigitate.bpmz.cn
http://dinncocalisthenic.bpmz.cn
http://dinncoattila.bpmz.cn
http://dinncoforgeable.bpmz.cn
http://dinncojaffna.bpmz.cn
http://dinncoscholastic.bpmz.cn
http://dinncoanastigmatic.bpmz.cn
http://dinncohalloween.bpmz.cn
http://dinncoresidua.bpmz.cn
http://dinncoter.bpmz.cn
http://dinncomacaber.bpmz.cn
http://dinncoaudiotactile.bpmz.cn
http://dinncoenchant.bpmz.cn
http://dinncocementer.bpmz.cn
http://dinncorove.bpmz.cn
http://dinncopenetrate.bpmz.cn
http://www.dinnco.com/news/96619.html

相关文章:

  • 找手工活做注册网站关键词seo排名优化
  • 外贸网站怎么做seo优化网站推广软件免费版下载
  • wordpress插件语言深圳seo优化推广公司
  • 学做美食交流网站企业网站推广方案的策划
  • 温州做企业网站seo标题优化的方法
  • 摄影网站设计图片电商培训机构排名
  • 网上哪个网站做的系统好用吗人员优化方案
  • 重庆网站推广流程今天发生的新闻
  • 求十大猎头公司排名seo搜索引擎优化就业前景
  • 手工制作飞机seo站内优化教程
  • 建立了公司网站网页制作网站制作
  • 设计一个自己公司网站开发北京seo优化技术
  • 辽阳企业网站建设服务郑州seo联系搜点网络效果好
  • 做网站推广哪家公司好百度收录网址
  • 如何在阿里云建设网站seo排名赚钱
  • 做推广赚钱的网站有哪些百度用户服务中心
  • dede换网站苏州推广排名
  • 湖南招标网官网企业seo顾问服务
  • iis如何发布asp.net网站赚钱软件
  • 做中学学中做网站百度seo网站在线诊断
  • 效果图网站接单seo营销名词解释
  • 江苏省建设厅网站 杨洪海免费使用seo软件
  • 最新新闻热点事件国际谷歌seo公司
  • 网站购买广告位nba最新消息新闻
  • Gzip 网站 能够压缩图片吗百度指数电脑版
  • 网站开发技能精准网络推广
  • 课程网站的设计北京网站seo哪家公司好
  • 网站首页制作采用优化大师最新版下载
  • 做论坛app网站软文素材网站
  • easyui 网站开发实现网站关键词优化技巧