2024-10-01 07:38:17 发布
网友
我试着运行以下代码。你知道吗
def fahrenheit(T): return (9.0/5)*T + 32 temp = [2 , 43 , 54 , 67 , 78 , 89.9] map(fahrenheit,temp)
为什么地图功能会打印
<map at 0x15a6cf17550>
使用list(map(fahrenheit,temp)),因为您需要列表表示
list(map(fahrenheit,temp))
[35.6, 109.4, 129.2, 152.60000000000002, 172.4, 193.82000000000002]
使用
list(map(fahrenheit,temp))
,因为您需要列表表示相关问题 更多 >
编程相关推荐