Using the random.choice function, this function requires a sequence, so a given sequence contains A-Z, A-Z

```#step1: Generating sequence
import random
s1=''
for i in range(97,123):
s1+=chr(i)+chr(i-32)
for i in range(9):
password+=random.choice(s1)#from s1 Random selection of an element in a sequence

2: generate a 9-digit number and letter password, which may appear randomly
On the basis of the previous question, this question becomes a sequence containing all letters and numbers, and then uses the random.choice() function

```import random
s1=''
for i in range(97,123):
s1+=chr(i)+chr(i-32)
s1+='0123456789'
print(s1)
#Generate a sequence of lowercase letters and numbers
#Another way of writing
import string
s1 = string.ascii_letters+string.digits
for i in range(9):

c1: length > = 8
c2: contains numbers and letters
c3: other visible special characters
Medium password condition: only any two conditions are met
Weak password condition: only 1 or 0 conditions are satisfied

Idea: first, write c1, c2 and c3 into functions, return True and False, True is satisfied, False is not satisfied

Step 1. Write three conditional functions

```def check_len(password):
return True
#Length greater than 8 True
else:
return False
import string
result =False
for i in string.ascii_letters:
#Case letters
for j in string.digits:
#number
result =True
return result
import string
result = False
for i in string.punctuation:
result =True
return result```

Check clecheck password length, check letter type check whether the password contains letters and numbers, check punctuation check whether the password contains special characters

Step 2: check that the password meets several conditions

```def pass_verify(password):
count = 0
#Use count To record password Several conditions are satisfied
count +=1
count +=1