I'm trying to write code to count the number of times a whole number can be divided by 2 before reaching 1.
When I run my code it prompts me to enter a number as you'll see in my code below, but once I do so, nothing happens, just a blank line appears. Does anyone know what I'm doing wrong? It's probably something so simple and insignificant but I'm new with Python. Thanks!
def main(): n = eval(input("Enter a number: ")) count = 0 while n > 0: if n // 2 > 1: count = count + 1 print(count) main()