loom-benchmark-mbpp / 113 /solution /_reference.py
sqy201x's picture
Add files using upload-large-folder tool
b2dd9e4 verified
Raw
History Blame Contribute Delete
328 Bytes
def check_integer(text):
text = text.strip()
if len(text) < 1:
return None
else:
if all(text[i] in "0123456789" for i in range(len(text))):
return True
elif (text[0] in "+-") and \
all(text[i] in "0123456789" for i in range(1,len(text))):
return True
else:
return False