def isInteger(s):
# Remove whitespace from the beginning and end of the string s = s.strip()
# Determine if the remaining characters form a valid integer
if (s[0] == "+" or s[0] == "-") and s[1:].isdigit():
return True
if s.isdigit():
return True
return False
1.为什么这里if连用,不用if-elif-else?
2.最后一个return为什么和两个if同级,没道理啊?不和返回True冲突吗?