【发布时间】:2020-09-18 07:46:59
【问题描述】:
lst = [["hi", "bye"], "hello", "goodbye", [9, 2], 4]
greeting_doubled = []
def f(g):
return 2*lst
greeting_doubled = map(f,lst)
print(greeting_doubled)
预期:
[['hi','bye','hi','bye'], 'hellohello', 'goodbyegoodbye',[9,2,9,2], 8]
【问题讨论】:
-
请格式化您的代码,您可以查看格式化规则here
标签: python python-3.x function dictionary oop