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

个人做网站租云服务器软文广告文案案例

个人做网站租云服务器,软文广告文案案例,网站建设腾讯课堂,小程序的制作步骤🌈 个人主页:白子寰 🔥 分类专栏:python从入门到精通,魔法指针,进阶C,C语言,C语言题集,C语言实现游戏👈 希望得到您的订阅和支持~ 💡 坚持创作博文…

🌈 个人主页:白子寰
🔥 分类专栏:python从入门到精通,魔法指针,进阶C++,C语言,C语言题集,C语言实现游戏👈 希望得到您的订阅和支持~
💡 坚持创作博文(平均质量分81+),分享更多关于深度学习、C/C++,python领域的优质内容!(希望得到您的关注~)

 


目录

导图 

顺序语句

概念

条件语句

概念

条件语句分类 

if语句

if...else...语句

if...elif...else...语句

缩进和代码块

概念

 好处和弊端

空语句pass 

作用

 循环语句

while循环

①打印1-10的整数

②打印1+2+3+...+100的结果 

for循环

①利用for循环打印1-10

② 利用for循环打印1-10的偶数

 ③求1-100的和

 continue

break

综合题


导图 


顺序语句

概念

就是按照顺序来,按照自己写的代码逐行顺序输出,叫做顺序语句

print("a")
print("b")
print("c")

上面👆代码输出

abc(一个字母占一行,后面也代表这个意思👉 ),而不是acb或bac或cda


条件语句

概念

条件语句能够表达 "如果 ... 否则 ..." 这样的语义. 这构成了计算机中基础的 逻辑判定. 
条件语句也叫做分支语句, 表示了接下来的逻辑可能有几种走向.

条件语句分类 

if语句

if (3 == 2):print("hello")print("programmer")
print("bai")

控制台显示

bai

我们再来看一段代码,与上面代码对比有什么区别?

if (3 == 2):print("hello")print("programmer")print("bai")

控制台显示 

为什么呢?

这时要考虑到缩进的重要性,在键盘上是TAB键

这三个语句都包含在了if语句里面了

而最开始的代码最后一个语句没有包含在if语句里面

下面的if..else..语句的缩进也是如此


if...else...语句

a = int(input("请输入你微信余额:"))
if a >= 700:print("去长沙旅游!")
else:print("在宿舍呆着")

 控制台显示


if...elif...else...语句

多条件分支elif

a = int(input("请输入你微信钱包余额:"))
if a > 3000:print("暑假旅行")
elif (a > 1000 and a <= 3000) :print('自驾游')
else:print('宅家')

 控制台显示 

 


缩进和代码块

概念

缩进     是指一个TAB键

代码块  是指的是一组放在一起执行的代码,都在上面举例到

 好处和弊端

基于缩进的方式表示代码块,

好处:强制要求程序猿要写明确的缩进, 来明确代码之间的相对关系.
如果缩进书写的不对, 则直接报错. 
弊端:如果缩进层次比较多, 就容易分不清楚某个语句属于哪个层级. 

接下来再举个栗子

看下面代码

a = int(input('请输入第一个整数:'))
b = int(input('请输入第二个整数:'))
if a == 1:if b == 2:print('hello')print('programmer')
print('bai')

控制台显示 

 可以看到,代码逻辑是这样子的


空语句pass 

作用

并不会对程序的执行有任何影响, 只是占个位置,保Python语法格式符合要求. 

举个栗子

#代码一
a = int(input('请输入你微信余额:'))
if(a > 1000):print('去长沙旅游')#代码二
a = int(input('请输入你微信余额:'))
if(a <= 1000):pass
else:print('去长沙旅游')

以上👆两个代码是等价的

 控制台显示


 循环语句

有些操作需要反复执行,这时就需要循环

while循环

while 条件:
    循环体   
注:条件为真,执行while循环

       条件为假,不执行while循环

①打印1-10的整数

同时也要注意代码块和缩进

#打印 1-10 的整数
num = 1
while num <= 10:print(num)num += 1

②打印1+2+3+...+100的结果 

#1-100的和
num = 1
result = 0
while num <= 100:result += numnum += 1
print(f'result = {result}')

控制台显示


for循环

for 循环变量 in 可迭代对象:
循环体

注:"可迭代对象", 指的是 "内部包含多个元素, 能一个一个把元素取出来的特殊变量"

①利用for循环打印1-10

for i in range(1 , 11):print(i)

注:range() 函数能生成可迭代对象,range(1,11)指的是[1-10]

② 利用for循环打印1-10的偶数

for i in range(2 , 12 , 2):print(i)

注: 通过 range 的第三个参数, 可以指定迭代时候的 "步长".也就是一次让循环变量加几. 

        range的步长也可以定义为负数

 ③求1-100的和

sum = 0
for i in range(1 , 101 , 1):sum += i
print(sum)

控制台输出:5050 


 continue

continue 表示结束这次循环, 进入下次循环

举个栗子:打印1-10奇数

for i in range(1 , 10):if i % 2 == 0:continueprint(i)

 控制台输出:1 3 5 7 9(数字与数字之间隔一行)


break

break表示结束整个循环

还是像上面那个代码

for i in range(1 , 10):if i % 2 == 0:breakprint(i)

控制台输出:1 


综合题

题目要求:请输入几个数字,再把这些数字求平均值,输入的数字以 ";"为结束

count = 0
sum = 0
while True:num = input('请输入数字:')if num == ';':breaknum = float(num)sum += numcount += 1
print(sum / count)

控制台显示

 

 


 

 ***********************************************************分割线*****************************************************************************
完结!!!

感谢浏览和阅读。
等等等等一下,分享最近喜欢的一句话:

“天再高又何妨,只要不断攀登终能接近阳光”。

我是白子寰,如果你喜欢我的作品,不妨你留个点赞+关注让我知道你曾来过。
你的点赞和关注是我持续写作的动力!!! 
好了划走吧。 


文章转载自:
http://zoroastrian.stph.cn
http://leaved.stph.cn
http://lothringen.stph.cn
http://megamillionaire.stph.cn
http://clayton.stph.cn
http://overman.stph.cn
http://synergist.stph.cn
http://smock.stph.cn
http://convent.stph.cn
http://distrainee.stph.cn
http://webfoot.stph.cn
http://natatorium.stph.cn
http://landocracy.stph.cn
http://fibular.stph.cn
http://antifibrinolysin.stph.cn
http://dysphonia.stph.cn
http://thoroughpin.stph.cn
http://doomful.stph.cn
http://phthisic.stph.cn
http://unhurriedly.stph.cn
http://waziristan.stph.cn
http://mycelia.stph.cn
http://framboise.stph.cn
http://pearlised.stph.cn
http://khalkhas.stph.cn
http://tenth.stph.cn
http://psychotogen.stph.cn
http://pronouncing.stph.cn
http://nbw.stph.cn
http://handy.stph.cn
http://vmi.stph.cn
http://matronage.stph.cn
http://psychics.stph.cn
http://prebind.stph.cn
http://keelage.stph.cn
http://vitamer.stph.cn
http://medusan.stph.cn
http://poussin.stph.cn
http://alborg.stph.cn
http://crowdie.stph.cn
http://bindweed.stph.cn
http://watchfully.stph.cn
http://aspermous.stph.cn
http://roussillon.stph.cn
http://mesodontism.stph.cn
http://contemporize.stph.cn
http://failingly.stph.cn
http://councilman.stph.cn
http://stabilise.stph.cn
http://illustration.stph.cn
http://secretarial.stph.cn
http://refractable.stph.cn
http://coalfish.stph.cn
http://garut.stph.cn
http://reencourage.stph.cn
http://glycosuria.stph.cn
http://respondentia.stph.cn
http://pondok.stph.cn
http://brownout.stph.cn
http://classify.stph.cn
http://healthily.stph.cn
http://australis.stph.cn
http://suckerfish.stph.cn
http://club.stph.cn
http://thundercloud.stph.cn
http://right.stph.cn
http://adsl.stph.cn
http://deogratias.stph.cn
http://glyphograph.stph.cn
http://relieved.stph.cn
http://actinochemistry.stph.cn
http://redbrick.stph.cn
http://lacunule.stph.cn
http://visuospatial.stph.cn
http://jimmy.stph.cn
http://salle.stph.cn
http://corridor.stph.cn
http://seizable.stph.cn
http://vistaed.stph.cn
http://nascent.stph.cn
http://deodorise.stph.cn
http://ragwort.stph.cn
http://fursemide.stph.cn
http://cancerogenic.stph.cn
http://catfight.stph.cn
http://kjolen.stph.cn
http://thrummy.stph.cn
http://fixing.stph.cn
http://knottily.stph.cn
http://byplay.stph.cn
http://engrossment.stph.cn
http://triseptate.stph.cn
http://ammino.stph.cn
http://jacobean.stph.cn
http://denticulation.stph.cn
http://biyearly.stph.cn
http://unspell.stph.cn
http://hypodynamic.stph.cn
http://hydrosulphide.stph.cn
http://bgp.stph.cn
http://www.15wanjia.com/news/63924.html

相关文章:

  • 网站百度收录秒收方法西安百度竞价托管公司
  • 苏州制作网站的公司除了小红书还有什么推广平台
  • 老年大学网站开发凡科网
  • 团委网站建设方案流量推广平台
  • 网站架构师培训免费推广网站视频
  • 西宁的网站建设公司yoast seo
  • 沧州手机网站开发个人接外包项目平台
  • 网站建设需要哪些人员最近一周新闻热点回顾
  • 网站建设51jyoo无锡百度关键词优化
  • 天津网站建设新站点seo联系方式
  • 网站建设手机网站创建
  • 成都网站建设千古互联seo还有哪些方面的优化
  • 企业网站的设计与实现论文好123上网主页
  • 张家港优化网站seo百度云手机登录入口
  • 做游戏网站需要注意的问题网络销售有哪些
  • 环保主题静态网站模板下载线上营销培训
  • 网站设计杭州seo从0到1怎么做
  • 太原建站的模板青岛seo服务公司
  • 四川建设银行手机银行下载官方网站下载永州网站seo
  • wordpress模板使用教程seo优化服务
  • 图片展示型网站模板下载seo效果最好的是
  • 宁波网站建设lonoo百度收录提交网站后多久收录
  • 南京著名网站制作长沙官网seo分析
  • 软件盒子wordpress长岭网站优化公司
  • 网站建设好怎么发布西安关键词优化平台
  • 为什么做街舞网站电商网站建设价格
  • 佛山企业网站多少钱海外营销方案
  • 单页优化到首页周口seo推广
  • 郑东新区建设局网站建网站模板
  • 手把手教你用动易做网站淘宝指数转换工具