<!--[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())
답:
이거 어디서 복붙한거임?
!supportEmptyParas!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
한글에서 복붙하면 저렇게 뜨네
나가뒤져 - dc App