码迷,mamicode.com
首页 > 编程语言 > 详细

python第二课

时间:2019-07-13 20:18:02      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:输出   进度   循环   字符串   bsp   not   int   while循环   image   

#格式化输出 %占位符,s字符串 d digit数字 %%只是单纯的显示%
#while else 当while循环被break打断,就不会执生else的结果
# % s d
# name = input(‘请输入姓名‘)
# age = input(‘请输入年龄‘)
# height=input(‘请输入身高‘)
# msg = "我叫%s,今年%s 身高%s" %(name,age,height)
# print(msg)
# name = input(‘请输入姓名:‘)
# age=input(‘请输入年龄:‘)
# job=input(‘请输入工作:‘)
# hobbie=input(‘你的爱好:‘)
# msg = ‘‘‘_________info of Ales Li_____________
# Name :%s
# Age :%d
# job :%s
# Hobbic :%s
# _______________end____________________‘‘‘%(name,int(age),job,hobbie)
# print(msg)

# name = input(‘请输入姓名‘)
# age = input(‘请输入年龄‘)
# height=input(‘请输入身高‘)
# msg = "我叫%s,今年%s 身高%s 学习进度3%%" %(name,age,height)#想要100%输出就加%
# print(msg)
#and or not
# x and y x True,则返回y
# print(2 > 1 and 1 < 4)
# print(2 > 1 and 1<4 or 2<3 and 9 > 6 or 2 < 4 and 3<2)
# print(0 or 4 and 3 or 2)
# print(2 or 1 < 3 and 2)
# print(1 and 2)
# print(0 and 2)

技术图片

 

python第二课

标签:输出   进度   循环   字符串   bsp   not   int   while循环   image   

原文地址:https://www.cnblogs.com/huangjianfeng/p/11181653.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!