@@ -45,24 +45,33 @@ def check_combo_input(combo_data):
4545 if user_input .strip () == '' :
4646 combo_good = False
4747 combo_msg = 'Must be Entered'
48-
49- elif 'int greater than' in combo_data [2 ]:
50-
51- if user_input .strip () == '' :
48+
49+ elif 'int ' or 'float' in combo_data [2 ]:
50+
51+ try :
52+ float (user_input )
53+ except :
5254 combo_good = False
53- combo_msg = 'Must be Entered '
54-
55+ combo_msg = 'Must be numeric '
56+
5557 if combo_good :
56- if 'equal ' in combo_data [2 ]: #handle equal greater than or equal to
58+ if 'int greater than ' in combo_data [2 ]:
5759
58- if int (user_input ) < int (combo_data [2 ].split ()[- 1 ]):
59- combo_good = False
60- combo_msg = f'Should be an Integer Greater than or Equal to { int (combo_data [2 ].split ()[- 1 ])} '
61- else :
62- if int (user_input ) <= int (combo_data [2 ].split ()[- 1 ]):
60+ if user_input .strip () == '' :
6361 combo_good = False
64- combo_msg = f'Should be an Integer Greater than { int (combo_data [2 ].split ()[- 1 ])} '
65-
62+ combo_msg = 'Must be Entered'
63+
64+ if combo_good :
65+ if 'equal' in combo_data [2 ]: #handle equal greater than or equal to
66+
67+ if int (user_input ) < int (combo_data [2 ].split ()[- 1 ]):
68+ combo_good = False
69+ combo_msg = f'Should be an Integer Greater than or Equal to { int (combo_data [2 ].split ()[- 1 ])} '
70+ else :
71+ if int (user_input ) <= int (combo_data [2 ].split ()[- 1 ]):
72+ combo_good = False
73+ combo_msg = f'Should be an Integer Greater than { int (combo_data [2 ].split ()[- 1 ])} '
74+
6675 return combo_good , combo_msg
6776def check_entry_input (entry_data ):
6877
@@ -86,13 +95,17 @@ def check_entry_input(entry_data):
8695 entry_good = False
8796
8897 if 'int ' in entry_data [2 ]:
98+
8999 if user_input .strip () != '' :
90100 try :
91101 user_input = int (user_input )
92102 except :
93103 entry_good = False
104+ entry_msg = 'Enter a'
94105 else :
95106 entry_good = False
107+ entry_msg = 'Must be Numeric'
108+
96109
97110 # If data good to this point, check if it is the right range
98111 if entry_good :
0 commit comments