Q:

How to fix syntax error 'continue' not properly in a loop in python

I want to create a simple database, which will store and return data.

The problem is that continue doesn't seem to work.
Once the else statement in function checker is executed it keeps printing "try again" and seems to be deadlocked.
def checker(): 
#Checks if the password is strong enough
while True:
   if (p[0].isupper() and not p.isalpha() and len(p) > 7):
   print('Password Created!')
   break
#If password is not strong enough try again
else:
    print('Try Again')
    continue

#Starts main program
while True:
  database = {'dom':'yeet'}
  welcome = input('Welcome! To login press L, if you are new press R: ')
  #Login will log basically check if your info is in dictionary
  if welcome == 'L':
    for user in database.keys():
      u = input('Username: ')
      if u in user:
          for passw in database.values():
            p = input('Password: ')
            if p in passw:
               print('Welcome ' + str(u))
               break
  #Will create new user in dictionary
  elif welcome == 'R':
    u = input('Choose your username: ')
    p = input('Choose your password: ')

  #Runs checker function
    checker()

    database[u] = p
    print('Welcome ' + str(u))
    break
 else:
    continue

A:

rewrite checker() like this:
You used incorrect indentation for the else block, and it was out of the loop.
def checker(): 
    #Checks if the password is strong enough
    while True:
        if (p[0].isupper() and not p.isalpha() and len(p) > 7):
            print('Password Created!')
            break

        else:
            print('Try Again')
            continue

