run a statement in the first loop python code example

Example 1: for loop python start at 1

# starts at 1 up to, but not including, 5
for i in range(1, 5)
	print(i)

Example 2: 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#