摘要: 1:编写for循环,利用索引遍历出每一个字符msg='hello egon 666' 一般做法:msg = 'hello egon 666' print([i for i in msg])xxxxxxxxxx2 1msg = 'hello egon 666'2print([i for i in msg])符合题意的做法:msg = 'hello egon 666' for i in range(l... 阅读全文
posted @ 2017-07-13 15:38 hsddon 阅读(111) 评论(0) 推荐(0) 编辑
摘要: #流程控制练习题: # >基础部分 #练习一: if True or False and False: print('yes') else: print('no') #输出结果为?为什么? if (True or False) and False: print('yes') else: print( 阅读全文
posted @ 2017-07-13 15:36 hsddon 阅读(146) 评论(0) 推荐(1) 编辑
摘要: python第一天作业1、使用while循环输出1 2 3 4 5 6 8 9 10i=1 while i<=10: print(i,end=' ') i += 1 x 1i=12while i<=10:3 print(i,end=' ')4 i += 15 2、求1-100的所有数的和print(sum(range(101)))xxxxxxxxxx1 1pri... 阅读全文
posted @ 2017-07-13 15:35 hsddon 阅读(114) 评论(0) 推荐(0) 编辑