File tree Expand file tree Collapse file tree 4 files changed +55
-28
lines changed Expand file tree Collapse file tree 4 files changed +55
-28
lines changed Original file line number Diff line number Diff line change 1- def collatz_steps (n ):
2- times = 0
1+ def collatz_sequence (n ):
2+ """Generate and print the Collatz sequence for n."""
3+ steps = [n ]
34 while n != 1 :
45 if n % 2 == 0 :
5- print (f"{ n } / 2" , end = " " )
6- n = n // 2 # "//" is a floor division where it rounds down the result
6+ n = n // 2
77 else :
8- print (f"{ n } * 3 + 1" , end = " " )
98 n = 3 * n + 1
10- print (f"= { n } " )
11- times += 1
12- print (f"The number of times to reach 1 is { times } " )
9+ steps .append (n )
10+ return steps
1311
14- def main ():
15- again = "y"
16- while again != "n" :
17- n = int (input ("Input a number: " ))
18- collatz_steps (n )
19- while True :
20- again = str (input ("Want to input again? y/n: " ))
21- if again != "n" and again != "y" :
22- print ("Incorrect Input." )
23- elif again == "n" :
24- print ("Thank You! Goodbye." )
25- break
26- else :
27- break
28-
29- main ()
12+ # --- Main Program ---
13+ try :
14+ num = int (input ("Enter a positive integer: " ))
15+ if num <= 0 :
16+ print ("Please enter a positive number greater than 0." )
17+ else :
18+ sequence = collatz_sequence (num )
19+ print ("\n Collatz sequence:" )
20+ for i , value in enumerate (sequence , start = 1 ):
21+ print (f"Step { i } : { value } " )
22+ except ValueError :
23+ print ("Invalid input! Please enter an integer." )
Original file line number Diff line number Diff line change 1- pyglet == 2.1.6
1+ pyglet == 2.1.8
Original file line number Diff line number Diff line change 1+ # Security Policy
2+
3+ ## Supported Versions
4+
5+ The project is currently at version ** 0.1** .
6+ It was initially compatible with ** Python 3.6+ ~ 3.13.7** ,
7+ but going forward we are migrating to ** Python 3.9+** as the minimum supported version.
8+
9+ | Version | Supported | Notes |
10+ | ------- | ------------------ | ------------------------------------------ |
11+ | 0.1.x | :white_check_mark : | Supported on Python 3.9+ (migration target) |
12+ | < 0.1 | :x : | Not supported |
13+
14+ | Python Version | Supported | Notes |
15+ | -------------- | ------------------ | -------------------------- |
16+ | 3.13.x | :white_check_mark : | Supported |
17+ | 3.12.x | :white_check_mark : | Supported |
18+ | 3.11.x | :white_check_mark : | Supported |
19+ | 3.10.x | :white_check_mark : | Supported |
20+ | 3.9.x | :white_check_mark : | Minimum required version |
21+ | 3.6–3.8 | :x : | Deprecated (no longer supported) |
22+
23+ ---
24+
25+ ## Reporting a Vulnerability
26+
27+ To report a security vulnerability:
28+
29+ - Please open a ** private security advisory** through GitHub Security Advisories
30+ (Repository → Security → Advisories → Report a vulnerability).
31+ - You will receive an initial response within ** 7 days** .
32+ - If the vulnerability is accepted, we will provide a patch or mitigation plan.
33+ - If declined, we will explain the reasoning in detail.
Original file line number Diff line number Diff line change @@ -49,16 +49,16 @@ auto-mix-prep==0.2.0
4949lib==4.0.0
5050pywifi==1.1.12
5151patterns==0.3
52- openai==1.99.9
52+ openai==1.100.2
5353background==0.2.1
5454pydantic==2.11.7
5555openpyxl==3.1.2
5656pytesseract==0.3.13
5757requests-mock==1.12.1
58- pyglet==2.1.6
58+ pyglet==2.1.8
5959urllib3==2.5.0
6060thirdai==0.9.33
61- google-api-python-client==2.177 .0
61+ google-api-python-client==2.179 .0
6262sound==0.1.0
6363xlwt==1.3.0
6464pygame==2.6.1
You can’t perform that action at this time.
0 commit comments