RE: [Golfing] Collatz Conjecture 08-21-2015, 04:37 PM
#5
(08-21-2015, 04:26 PM)Shebang Wrote: What exactly do we need to print, if anything?
Anyways, here's a straightforward Python solution (46 Bytes).
Code:n=input() while n>1:n=[n/2,3*n+1][n%2];print n
You're lucky Stuck has no while-loops ;P
As someone learning Python, that line of code makes me cry internally, although it is correct and effective. Although I'm confused on how it functions without any if-statements or loops. (Python 3 user)
Tik Tak~! Time is up~!


![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)