Answer:
The function is as follows:
def concList(aList):
retList = ""
for i in aList:
if(str(i).isdigit()):
retList+=str(i)
else:
retList = "Not digits"
break;
return retList
Explanation:
This defines the function
def concList(aList):
This initializes the return string to an empty string
retList = ""
This iterates through aList
for i in aList:
This converts each element of the list to an empty list and checks if the string is digit
if(str(i).isdigit()):
If yes, the element is concatenated
retList+=str(i)
If otherwise
else:
The return string is set to "No digits"
retList = "Not digits"
And the loop is exited
break;
This returns the return string
return retList