📜  python loop back to start - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:29.545000             🧑  作者: Mango

代码示例1
def main(): #defines the area in indents that will be triggered with main()#
  print('hi')
  yn = input('Wanna loop back to the start? ')
  if yn = 'yes':
    main() #loops back to where we defined main#
    
main() #This starts the main loop, without this, main would just be defined but not run#