一行代码实现1--100之和

>>> sum(range(0,101))
5050

或者

>>> sum(i for i in range(0,101))
5050
原文地址:https://www.cnblogs.com/sea-stream/p/10765843.html