Python编程快速上手——让繁琐工作自动化第四章实践题

xiaoxiao2021-02-28  1

4.10.1:

def hanshu(spam):    zifu = spam[0]    for i in range(1,int(len(spam)-1),1):        zifu = zifu + ', '+spam[i]    zifu = zifu + ', and ' +spam[int(len(spam)-1)]    print(zifu)                   i = 1;spam = []while True:    print('输入一个列表的第' + str(i) + '个值:')    zhi = input()    if zhi == '':        break    else:        spam = spam + [zhi]        i = i+1hanshu(spam)

4.10.2:

转载请注明原文地址: https://www.6miu.com/read-1600348.html

最新回复(0)