From: Mauro Scomparin Date: Wed, 12 Apr 2017 03:47:04 +0000 (+0200) Subject: Corretta gestione numeri positivi senza +. X-Git-Url: https://git.scompo.it/?a=commitdiff_plain;h=fb5a1fb4ef35be04135c6e6b91bfda993d0aedfa;p=money.git Corretta gestione numeri positivi senza +. --- 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():