python loop back to start

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#

Here is what the above code is Doing:
1. It defines a function called main()
2. It tells the function to print ‘hi’
3. It tells the function to ask the user if they want to loop back to the start
4. If the user says ‘yes’, it tells the function to loop back to the start
5. It tells the function to start the main loop