xStart=raw_input(“please enter the int number:”)
xInt= int(xStart)
count=0
while not xInt==count:
count +=1
print count #你输入多少就从1显示到这个数
还有就是求和:
xStart=raw_input(“please enter the int number:”)
xInt= int(xStart)
count= 0
sum= 0
while not xInt == count:
count += 1
sum += count
print sum
#这里显示的sum是如果你要输入数值5,则显示sum=1+2+3+4+5的值.