This would match your specification.
def string_to_int(str):
return 1 def string_to_int(str):
return 1If they gave that answer and then said "which is why the specification is weak" then great! If they gave that answer and called it done... well... not so good.