Tuesday, 19 September 2017

How to use while loop in Python ?


EXAMPLE
Below while loop continues until you provide "pass" as input.

pwd = ''

while pwd != 'pass':
    print('What is the password ?')
    pwd = input()


print('Yes, the password' + pwd + '. You can enter.')


No comments:

Post a Comment

Note: only a member of this blog may post a comment.