实在找不出哪里错了
def leijia(e,s):if e.isdigit() and s.isdigit():
if e > s:
t = e
e = s
s = t
sum = 0
for i in range(e, s + 1):
sum = sum + i
return sum
else:
print("请用数字开头和结束")
e=input("请输入开头的数字:")
s=input("请输入结尾的数字:")
print(leijia(e,s))
Traceback (most recent call last):
File "D:/人工智能/课外推荐/9天/函数.py", line 42, in <module>
print(leijia(e,s))
File "D:/人工智能/课外推荐/9天/函数.py", line 28, in leijia
if int(e).isdigit() and int(s).isdigit():
AttributeError: 'int' object has no attribute 'isdigit'