📌  相关文章
📜  lambda x: %d % ', '.join(x) for integers - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:52.041000             🧑  作者: Mango

代码示例1
>>> nums = [1, 2, 3]
>>> magic = lambda nums: int(''.join(str(i) for i in nums)) # Generator exp.
>>> magic(nums)
123
>>> magic = lambda nums: sum(digit * 10 ** (len(nums) - 1 - i) # Summation
...     for i, digit in enumerate(nums))
>>> magic(nums)
123