PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'''
Passwordvalidator
By John
This program takes user inputs and determines the acceptable password choice
'''
import sys
print(sys.version)
nums = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
special_char = ["!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+"]
def check_password():
choice = input("Create password: ")
password = choice.split(' ')
if len(password) > 1:
print("password cannot contain spaces")
elif len(password[0]) in range(5, 11):
for i in nums:
if i in password[0]:
for v in special_char:
if v in password[0]:
print("password {} is valid".format(password[0]))
break
else:
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run