测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A26862. 有关下列Python代码的说法,错误的是( )。#自定义函数SORTED()仿Python的sorted()功能 def SORTED(for_in_data, fx = None, Reverse = False): lst = list(for_in_data) if fx == None: lst.sort(reverse = Reverse) else: lst.sort(key = l…

单选题 困难

题目描述

有关下列Python代码的说法,错误的是(    )。

#自定义函数SORTED()仿Python的sorted()功能
def SORTED(for_in_data, fx = None, Reverse = False):
	lst = list(for_in_data)
	if fx == None:
		lst.sort(reverse = Reverse)
	else:
		lst.sort(key = lambda x:fx(x), reverse = Reverse)
	return lst

选项(单选)

上一题 下一题