# Lecture 11 fall 2008
def silly():
res = []
done = False
while not done:
while not done:
elem = input('Enter element. Return when done. ')
if elem == '':
done = True
else:
res.append(elem)
tmp = res[:]
tmp.reverse()
isPal = (res == tmp)
if isPal:
print ('is a palindrome')
else:
print ('is NOT a palindrome')
Lecture 11: Testing and debugging
最新推荐文章于 2021-01-30 04:30:01 发布