发布于 1年前 Python 如何实现字典推导式 dict_numbers = {x: x*x for x in range(1, 5)} print(dict_numbers) # {1: 1, 2: 4, 3: 9, 4: 16}