2019年5月31日
摘要: name = input('请输入姓名:')do = input('在做什么:')template = ('%s在教室,%s。'%(name,do,)) # '''%s相当于占位符,%后括号里是对%s进行解释填充 #最后加逗号表示填充完毕 '''print(template)# 示例代码eg = ' 阅读全文
posted @ 2019-05-31 22:33 张一工 阅读(88) 评论(0) 推荐(0)
摘要: # 1.循环打印"人生苦短,及时行乐。"while True: print('人生苦短,及时行乐')# 2.while后加入条件while 1 > 0: print('人生苦短,不如去死')# 3.数字相加count = 1count = count + 1print(count)# 4.通过循环, 阅读全文
posted @ 2019-05-31 22:30 张一工 阅读(135) 评论(0) 推荐(0)
摘要: # 打印练习# _*_ coding:utf-8 _*_ (将编码转换为utf-8)print('您好!')print('hello_world!')print(1,2,3,4)password = 123print('密码:',password)# 布尔型num = 18num1 = num > 阅读全文
posted @ 2019-05-31 22:21 张一工 阅读(122) 评论(0) 推荐(0)