<!--[if !supportEmptyParas]--> <!--[endif]-->
수업 시간에 다음과 같은 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())
답:
답좀알려주세요 부탁드려요 ㅠㅠ
복학했다는 핑계로 자신의 무능을 얼버무리려 하다니
;
다시 휴학 ㄱㄱ
;