📜  如何在python代码示例中添加列表编号

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

代码示例1
lst = []
num = int(input('How many numbers: '))
for n in range(num):
    numbers = int(input('Enter number '))
    lst.append(numbers)
print("Sum of elements in given list is :", sum(lst))