python--练习--for i in

发布时间:2019-08-05 15:35:17编辑:auto阅读(1670)

    #!/usr/bin/python3
    total1=0
    total2=0
    for i in range(2,101):
    if i%2==0 :
    total1+=i

    else:
        total2+= -i

    total=total1+total2

    print(total)

关键字