def listMaker(a, b):
if b.isdigit() == False:
print("Sorry is not a valid input")
else:
newList = [a] * b
return newList
Run Code Online (Sandbox Code Playgroud)
我收到错误:
AttributeError: 'int' object has no attribute 'isdigit'
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?