Day 1: The full function
"def check_password(password):
if len(password) < 8:
return "Weak"
has_number = False
for char in password:
if char.isdigit():
has_number = True
if has_number:
return "Strong"
return "Medium""
"The whole function, start to finish. Under 8 characters? It answers "Weak" right away. Otherwise it walks through the password looking for a digit - found one, it's "Strong"; none, it's "Medium". Read it, run it, get a feel for the shape."
Get the audio by subscribing below 👇
Day 2: The first lines fade
"def check_password(password):
____
____
has_number = False
for char in password:
if char.isdigit():
has_number = True
if has_number:
return "Strong"
return "Medium""
"Today's lines: the length check. if len(password) < 8 asks one question before anything else - too short? Then return "Weak" ends the function right there. Everything below only runs for passwords that pass."
Get the audio by subscribing below 👇
Day 3: More lines to fill
"def check_password(password):
____
____
has_number = False
for char in password:
____
____
if has_number:
return "Strong"
return "Medium""
"Today's lines: the loop body. if char.isdigit() checks each character in turn, and has_number = True flips the flag the moment a digit shows up. The for line stays put - it's part of your skeleton."
Get the audio by subscribing below 👇
Day 4: Test your memory
"def check_password(password):
____
____
____
for char in password:
____
____
if has_number:
____
return "Medium""
"Most of the body is gone now. Only the skeleton holds the shape: the def line, the for loop, if has_number, and the final return "Medium". Can you say out loud what belongs on each blank line?"
Get the audio by subscribing below 👇
Day 5: Write it from memory
"def check_password(password):
____
____
____
for char in password:
____
____
____
____
return "Medium""
"From memory now: write the body back into the skeleton. Answer key: the length check returns "Weak" early, the loop hunts for a digit, "Strong" if it finds one, "Medium" if it doesn't. Paste your version into Ada and watch it run."
Get the audio by subscribing below 👇