chore: limpopo update
This commit is contained in:
36
2021-03-04/password.py
Normal file
36
2021-03-04/password.py
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
# Max's Original Solution
|
||||
# password = input("Enter password: ")
|
||||
# contain_digit = False
|
||||
# length = len(password)
|
||||
|
||||
|
||||
# while contain_digit == False and length < 8:
|
||||
# for char in password:
|
||||
# if char.isnumeric():
|
||||
# contain_digit = True
|
||||
# break
|
||||
# else:
|
||||
# contain_digit = False
|
||||
# password = input("Enter valid password: ")
|
||||
# length = len(password)
|
||||
|
||||
|
||||
password = input("Enter password: ")
|
||||
valid = False
|
||||
|
||||
while not valid:
|
||||
# Check whether there's a digit
|
||||
contains_digit = False
|
||||
|
||||
for char in password:
|
||||
if not contains_digit and char.isnumeric():
|
||||
contains_digit = True
|
||||
|
||||
valid = contains_digit and len(password) > 8
|
||||
|
||||
if not valid:
|
||||
password = input("Enter valid password: ")
|
||||
|
||||
|
||||
print("Valid Password")
|
||||
17
2021-03-04/url_validate.py
Normal file
17
2021-03-04/url_validate.py
Normal file
@@ -0,0 +1,17 @@
|
||||
string = input("Gimme string: ")
|
||||
valid = False
|
||||
start = False
|
||||
end = False
|
||||
|
||||
while not valid:
|
||||
if string[0:6] == "http://":
|
||||
start = True
|
||||
else:
|
||||
start = False
|
||||
if string[-4:] == ".com":
|
||||
end = True
|
||||
else:
|
||||
end = False
|
||||
valid = start and end
|
||||
if not valid:
|
||||
string = input("gimme good string: ")
|
||||
Reference in New Issue
Block a user