Python Arithmetic Sequence Sum

前端 未结 0 538
醉话见心
醉话见心 2020-12-20 01:02

How do I make a code that follows this? 1⋅2+2⋅3+3⋅4+…+(n−1)⋅n

For example, if n=5, the answer is 1⋅2+2⋅3+3⋅4+4⋅5=40.

n c

相关标签:
回答
  • 消灭零回复
提交回复
热议问题