我想知道我们有什么更好的选择,例如调用诸如help()的功能或返回诸如return help()的功能,以及什么时候该变得更好呢?
我的原始代码:
while True:
def help():
print('C - to create new list, D - to delete existing list, L - see all your lists')
return welcome()
def clist():
c = input('Choose name for our list: ')
c = []
return(c)
def welcome():
w = input('Choose action, press H for help: ')
if (w == 'h'):
return help()
welcome()
可以更改为什么:
while True:
def help():
print('C - to create new list, D - to delete existing list, L - see all your lists')
welcome()
def clist():
c = input('Choose name for our list: ')
c = []
return(c)
def welcome():
w = input('Choose action, press H for help: ')
if (w == 'h'):
help()
welcome()