<!--[if !supportEmptyParas]--> <!--[endif]-->

7. 수업 시간에 다음과 같은 6자리 패스워드 생성 함수 genPass()를 설명하였다. 함수를 수정하여 7자리 패스워드의 마지막에 반드시 하나의 숫자를 가지도록 프로그램을 수정하고, 이를 실행해서 작동하는 소스코드 genPassTest.py를 제출하시오. (4)

import random

<!--[if !supportEmptyParas]--> <!--[endif]-->

def genPass():

alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"

password = "“

<!--[if !supportEmptyParas]--> <!--[endif]-->

for i in range(6):

index = random.randrange(len(alphabet))

password = password + alphabet[index]

return password

<!--[if !supportEmptyParas]--> <!--[endif]-->

print(genPass())

print(genPass())

print(genPass())