Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
spyrothedragon committed Oct 22, 2024
1 parent dbaf6b3 commit 70dac1b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Beginner Level 📁/Collatz's Hypothesis/Collatz's hypothesis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
c0 = int(input("Enter an integer and non-zero number: "))
steps = 0
while c0 != 1:
if c0%2 ==0:
c0 = c0/2
steps += 1
elif c0%2 !=0:
c0= (3*c0) + 1
steps += 1
print(int(c0))
print("steps =", steps)
2 changes: 1 addition & 1 deletion Beginner Level 📁/Collatz's Hypothesis/question.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@

Enter an integer to test Collatz's hypothesis.

0 comments on commit 70dac1b

Please sign in to comment.