1.实现栈: stack=[] def pushit(): stack.append(raw_input('Enter New String:').strip()) def popit(): if len(stack)==0: print 'can not pop anything from a empty stack' else: print 'Remove[',repr(stack.pop()),']' def viewstack(): print stack CMDs={'u':pushi…