def main():
sum=0
print "This program sums a series of integers."
n=int(raw_input("Enter integers (0 to terminate): ")) #input the integers to operate on
while(n!=0):
sum=sum+n #calculating sum till 0 encountered
n=input()
print "The sum is: %d" % sum #printing sum
if __name__=='__main__':
main()
def main():
str=raw_input("Enter a message: ") #input string
length=len(str) #calculate length
print "Your message was %d character(s) long" % length #display length
if __name__=='__main__':
main()