函数main接收一个列表参数lst 要求判断是否其中只包含整数或实数类型的元素,如果是返回True 否则返回False。要求不用循环和选择结构
def main(lst): lst2 = [temp for temp in lst if isinstance(temp, int)] if len(lst2) == len(lst): return True else: return False