摘要: 000-- the way to define a string with several lines 001--to get specific letters from a string 002-- the common error message for new beginner while r 阅读全文
posted @ 2017-06-05 20:16 ReedyLi 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 000--functions for Tuple(the highlight ones) VS functions for List 001-- add one more tuple to original one with only 1 element, you need you use '' a 阅读全文
posted @ 2017-06-03 09:36 ReedyLi 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 000-- List comprehensions Above one is equal to : for the first one, it's equal to : 001-- list functions: list.sort() list.reverse() == list.sort(rev 阅读全文
posted @ 2017-06-02 09:28 ReedyLi 阅读(121) 评论(0) 推荐(0) 编辑
摘要: List Slice 001-- to read specific elements in the list 001-- the difference between list2=list1[:] and list3=list1 阅读全文
posted @ 2017-06-01 16:24 ReedyLi 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 00-- print every 2 members in the list : 001--print the members with index in the list: 002-- the difference between append(), extend(), insert() : ht 阅读全文
posted @ 2017-06-01 15:47 ReedyLi 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 01--Password verification 002- sort the number which equal to its own number's cubic 003--combination of different color balls : Note: 1-- break only 阅读全文
posted @ 2017-06-01 10:10 ReedyLi 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 0-- print A/B/C/D rather than detail score: score = float(input('please input your score: ')) if score>=90: print('A')elif 80<=score<90: print('B')eli 阅读全文
posted @ 2017-05-25 16:55 ReedyLi 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 0- print all the odds in range 0-100: for i in range (101): if i%2!=0: print(str(i)) 1-- Einstein conundrum: for i in range (10000): if i%2==1 and i%3 阅读全文
posted @ 2017-05-25 16:21 ReedyLi 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 0--Update the small game to check the type of the guess import random answer = random.randint(1,10) guess = input('please input your guess: ' ) i=2 wh 阅读全文
posted @ 2017-05-25 00:32 ReedyLi 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 0 small games: number guess: import random answer = random.randint(1,10) guess = int(input('please input your guess: ' )) i = 2 while i : if guess != 阅读全文
posted @ 2017-05-22 22:39 ReedyLi 阅读(153) 评论(1) 推荐(0) 编辑