From fb5a1fb4ef35be04135c6e6b91bfda993d0aedfa Mon Sep 17 00:00:00 2001 From: Mauro Scomparin Date: Wed, 12 Apr 2017 05:47:04 +0200 Subject: [PATCH] Corretta gestione numeri positivi senza +. --- money.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/money.py b/money.py index 6a6b063..6596c53 100755 --- a/money.py +++ b/money.py @@ -5,9 +5,13 @@ from os.path import expanduser, join from pprint import pprint def leggi_tipo(): - t = input('tipo (+/-) [-]: ') + t = 'n' + while not (t == '' or t == '+' or t == '-'): + t = input('tipo (+/-) [-]: ') if t == '': t='-' + elif t == '+': + t='' return t def leggi_valore(): -- 2.25.1