Corretta gestione numeri positivi senza +.
authorMauro Scomparin <scompo@gmail.com>
Wed, 12 Apr 2017 03:47:04 +0000 (05:47 +0200)
committerMauro Scomparin <scompo@gmail.com>
Wed, 12 Apr 2017 03:47:04 +0000 (05:47 +0200)
money.py

index 6a6b0636b6867dbfefe0e82dc98a896cf54a97ef..6596c53f26d9e972ef9fe50d7af6f47ed7a8479b 100755 (executable)
--- 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():