from __future__ import print_function
-import string
+
+
+try:
+ raw_input
+except NameError: # Python 3
+ raw_input = input
def hmenu(prompt, astring):
result = raw_input(prompt)
try:
- result = string.atoi(result)
- except string.atoi_error:
+ result = int(result)
+ except ValueError:
result = -1
return result