Is there a more elegant way to write this loop in python?

后端 未结 0 1608
猫巷女王i
猫巷女王i 2020-12-09 08:16

I am trying to write the script below in a more elegant format. Any suggestion?

list = [1,2,3,4]

for i in list:
    a = [(i + j) for j in list]
相关标签:
回答
  • 消灭零回复
提交回复
热议问题