Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 18 additions & 24 deletions Collatz Sequence/Collatz Sequence.py
Original file line number Diff line number Diff line change
@@ -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.")
2 changes: 1 addition & 1 deletion PongPong_Game/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pyglet==2.1.6
pyglet==2.1.8
33 changes: 33 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 3 additions & 3 deletions requirements_with_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading