python1+..+100

python1+..+100

# -*- coding: cp936 -*-
y = "yes"
while y == "yes":
           print "please input num"
           a = input()
           print "please input endnum"
           c = input()
           b=a+1
           while b<=c:
               a=a+b
               b=b+1
           print '答案爲:' ; print a
           #y = "no"                        #取消“#”就是控制循環
           print "go on!? (yes or no):"
           #y = raw_input()   #把輸入結果作爲字符串給予變量y


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章