From a9a5c4b7cba255afbc36fc20bc669e007c0d7854 Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Wed, 8 Apr 2026 13:50:35 +0200 Subject: [PATCH] aggiunge esercizio 19 --- lab19.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lab19.py diff --git a/lab19.py b/lab19.py new file mode 100644 index 0000000..bffc59f --- /dev/null +++ b/lab19.py @@ -0,0 +1,14 @@ +c0 = int(input("Inserire un numero intero positivo: ")) +passi=0 + +while c0 > 1: + + if c0 % 2 == 0: + c0 /= 2 + + else: + c0 = c0*3+1 + + passi += 1 + +print("passi", passi) \ No newline at end of file