Discuss / Python / 如何测试编辑一个TypeError

如何测试编辑一个TypeError

Topic source

youwbo

#1 Created at ... [Delete] [Delete and Lock User]

def product(x): if x is None: print('TypeError') return sum=1 for n in x: sum=sumn return sum

youwbo

#2 Created at ... [Delete] [Delete and Lock User]

#上面那个有问题

def product(x): if x is None: return TypeError sum=1 for n in x: sum=sumn return sum

youwbo

#3 Created at ... [Delete] [Delete and Lock User]

我记得之前的教程好像出现过

youwbo

#4 Created at ... [Delete] [Delete and Lock User]

星号被吞了


  • 1

Reply