摘要: alist = [1,2,3,'bob','alice'] print(alist) alist[0] = 10 print(alist) alist[1:3] = [20,30] print(alist) alist[2:2] = [22,24,26,28] print(alist) alist.append(100) print(alist) alist.remove(24) pr... 阅读全文
posted @ 2019-05-21 11:21 hejp 阅读(132) 评论(0) 推荐(0) 编辑
摘要: import os def get_fname(): while True: fname = input('filename: ') if not os.path.exists(fname): break print('%s already exists. Try again' % fname) ... 阅读全文
posted @ 2019-05-21 11:01 hejp 阅读(239) 评论(0) 推荐(0) 编辑