def select(): print(‘select功能‘) def delete(): print(‘delete功能‘) def insert(): print(‘insert功能‘) def updata(): print(‘updata功能‘) dic = { ‘select‘:‘select‘, ‘delete‘:‘delete‘, ‘insert‘:‘insert‘, ‘updata‘:‘updata‘ } def main (): while True: inp=input(‘>>‘).strip() if not inp:continue for i in dic: if inp in i: inp() # if inp == ‘select‘: # select() # elif inp ==‘delete‘: # delete() # elif inp ==‘insert‘: # insert() # elif inp == ‘updata‘: # updata() # else: # print(‘输入有误.‘) # continue main()
时间: 2024-12-09 07:43:11