This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # A strong password must have: | |
| # At least 8 characters long | |
| # At least one uppercase letter (A-Z) | |
| # At least one lowercase letter (a-z) | |
| # At least one number (0-9) | |
| # Keep asking for a password until all requirements are met | |
| # Give helpful feedback about what's missing | |
| is_strong = False | |
| while not is_strong: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| decided_to_quit = False | |
| while not decided_to_quit: | |
| num = input("Enter the number: ") | |
| num = int(num) | |
| # how many rows to display? | |
| rows = input("Enter the number of rows: ") | |
| rows = int(rows) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Number guessing game | |
| # 7 attempts | |
| # "too high" or "too low" indication | |
| from random import randint | |
| answer = 62 #randint(1, 100) | |
| attempts = 7 | |
| while attempts > 0: | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print("=== Multiplication Table Generator ===\n") | |
| continue_program = "yes" | |
| while continue_program == "yes": | |
| # Get user input | |
| number = int(input("Which number's table do you want? ")) | |
| rows = int(input("How many rows? ")) | |
| # Display table header |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Scaffold for number guessing game | |
| attempts = 7 | |
| # Uncomment the following lines to get a random number | |
| # from random import randint | |
| # answer = randint(0, 100) | |
| while attempts > 0: | |
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| age = int(input("Enter your age: ")) | |
| days = """ | |
| 1: Sunday | |
| 2: Monday | |
| 3: Tuesday | |
| 4: Wednesday | |
| 5: Thursday | |
| 6: Friday | |
| 7: Saturday | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| age = int(input("Enter your age: ")) | |
| CURRENT_YEAR = 2026 | |
| birth_year = CURRENT_YEAR - age | |
| # ========== Life Stage ============== | |
| if 0 <= age <= 12: | |
| print("🎭 Life Stage: Child") | |
| elif 13 <= age <= 19: | |
| print("🎭 Life Stage: Teenager") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| history = [] | |
| while True: | |
| if history != []: | |
| continue_input = input("Do you want to continue (y/n): ") | |
| if continue_input == "y": | |
| pass | |
| elif continue_input == "n": | |
| print("Logs: ") | |
| for h in history: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>YouTube Video Summary</title> | |
| <style> | |
| :root { | |
| --jeans: #1a224a; | |
| --jeans-light: #232d5c; |