# go through each member of your list and call the
# builtin string method `isdigit` check out the documentation
digits = [int(s) for s in your_list if s.isdigit()]
# use the built in `sum` function and the builtin `len` function
sum(digits) / len(digits)
使用
try
。你知道吗基本上,这会尝试将它添加到
sum
。如果失败了,它还会继续。你知道吗试试这个:
你可以这样做:
相关问题 更多 >
编程相关推荐