Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: or a user setting up a new account of some sort) until one is given, or the user reaches the maximum guesses allowed. You must use a while-loop in your solution. You may assume that max_attempts is at least 1. 0 168 t ID: Tes : 16 80 ID st : Do wn lo ad er ID 29 85 Te def get_password (max_attempts): ’’’Prompt the user for a valid password until a valid one is given or they have entered max_attempts invalid passwords. A valid password is one that is at least length 6 and is not the word "password". Each time the user gives an invalid password, tell them that it was invalid and prompt again if they have not reached max_attempts tries. If the user gives max_attempts invalid passwords, return the empty string; otherwise return the valid password they gave’’’. Te st ID : 16 80 16 ade r ID: 298 5 ID: 2985 ID : Downl oader om nlo 80 Dow Te 2985 ader ID: Downlo st ID : y. c st 80 16 nlo Dow ad e r ID : de nt bu dd r ID: ade Do wn 5 lo 298 er ID: 2985 85 29 ID : er ad lo 0 Tes t ID: 168 :...
View Full Document

This note was uploaded on 11/27/2010 for the course CS 108 taught by Professor Paulgries during the Spring '08 term at University of Toronto- Toronto.

Ask a homework question - tutors are online