seed: curriculum content
This commit is contained in:
17
1.solar-system/3.strings/04.the-validator/starter/starter.py
Normal file
17
1.solar-system/3.strings/04.the-validator/starter/starter.py
Normal file
@@ -0,0 +1,17 @@
|
||||
def validate(pw):
|
||||
"""Check four properties of a non-empty password and return a dict.
|
||||
|
||||
Keys:
|
||||
"length" — number of characters (int)
|
||||
"long_enough" — True if length >= 8 (bool)
|
||||
"starts_capital" — True if first char is uppercase (bool)
|
||||
"ends_digit" — True if last char is a digit (bool)
|
||||
|
||||
Helpers:
|
||||
pw[0].isupper() — True if first char is uppercase
|
||||
pw[-1].isdigit() — True if last char is a digit
|
||||
|
||||
validate("Andromeda1") -> {"length": 10, "long_enough": True,
|
||||
"starts_capital": True, "ends_digit": True}
|
||||
"""
|
||||
pass
|
||||
Reference in New Issue
Block a user