diff --git a/Collatz Sequence/Collatz Sequence.py b/Collatz Sequence/Collatz Sequence.py index d9e29e52332..eafc7422397 100644 --- a/Collatz Sequence/Collatz Sequence.py +++ b/Collatz Sequence/Collatz Sequence.py @@ -1,29 +1,23 @@ -def collatz_steps(n): - times = 0 +def collatz_sequence(n): + """Generate and print the Collatz sequence for n.""" + steps = [n] while n != 1: if n % 2 == 0: - print(f"{n} / 2", end=" ") - n = n // 2 # "//" is a floor division where it rounds down the result + n = n // 2 else: - print(f"{n} * 3 + 1", end=" ") n = 3 * n + 1 - print(f"= {n}") - times += 1 - print(f"The number of times to reach 1 is {times}") + steps.append(n) + return steps -def main(): - again = "y" - while again != "n": - n = int(input("Input a number: ")) - collatz_steps(n) - while True: - again = str(input("Want to input again? y/n: ")) - if again != "n" and again != "y": - print("Incorrect Input.") - elif again == "n": - print("Thank You! Goodbye.") - break - else: - break - -main() +# --- Main Program --- +try: + num = int(input("Enter a positive integer: ")) + if num <= 0: + print("Please enter a positive number greater than 0.") + else: + sequence = collatz_sequence(num) + print("\nCollatz sequence:") + for i, value in enumerate(sequence, start=1): + print(f"Step {i}: {value}") +except ValueError: + print("Invalid input! Please enter an integer.") diff --git a/PongPong_Game/requirements.txt b/PongPong_Game/requirements.txt index 71000361bd6..92f7e34e3fc 100644 --- a/PongPong_Game/requirements.txt +++ b/PongPong_Game/requirements.txt @@ -1 +1 @@ -pyglet==2.1.6 +pyglet==2.1.8 diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000000..f0c2eb583a7 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,33 @@ +# Security Policy + +## Supported Versions + +The project is currently at version **0.1**. +It was initially compatible with **Python 3.6+ ~ 3.13.7**, +but going forward we are migrating to **Python 3.9+** as the minimum supported version. + +| Version | Supported | Notes | +| ------- | ------------------ | ------------------------------------------ | +| 0.1.x | :white_check_mark: | Supported on Python 3.9+ (migration target) | +| < 0.1 | :x: | Not supported | + +| Python Version | Supported | Notes | +| -------------- | ------------------ | -------------------------- | +| 3.13.x | :white_check_mark: | Supported | +| 3.12.x | :white_check_mark: | Supported | +| 3.11.x | :white_check_mark: | Supported | +| 3.10.x | :white_check_mark: | Supported | +| 3.9.x | :white_check_mark: | Minimum required version | +| 3.6–3.8 | :x: | Deprecated (no longer supported) | + +--- + +## Reporting a Vulnerability + +To report a security vulnerability: + +- Please open a **private security advisory** through GitHub Security Advisories + (Repository → Security → Advisories → Report a vulnerability). +- You will receive an initial response within **7 days**. +- If the vulnerability is accepted, we will provide a patch or mitigation plan. +- If declined, we will explain the reasoning in detail. diff --git a/requirements_with_versions.txt b/requirements_with_versions.txt index 7146137effe..84c8fe7008f 100644 --- a/requirements_with_versions.txt +++ b/requirements_with_versions.txt @@ -49,16 +49,16 @@ auto-mix-prep==0.2.0 lib==4.0.0 pywifi==1.1.12 patterns==0.3 -openai==1.99.9 +openai==1.100.2 background==0.2.1 pydantic==2.11.7 openpyxl==3.1.2 pytesseract==0.3.13 requests-mock==1.12.1 -pyglet==2.1.6 +pyglet==2.1.8 urllib3==2.5.0 thirdai==0.9.33 -google-api-python-client==2.177.0 +google-api-python-client==2.179.0 sound==0.1.0 xlwt==1.3.0 pygame==2.6.1