What is wrong with this code?
import time
import sys
print """Welcome to the age finder.
This program takes some input (they will be the years) and then
adds it to 4 ages. For example, if you give the ages 10, 11, 12
and 13 it will return the age added to your first input.
"""
# These are the years to add.
print "Enter the number of years to be added:"
yearstoadd = int(sys.stdin.readline())
# These are the ages to add.
print "Enter the first age:"
num1 = int(sys.stdin.readline())
if num1 > 100:
print "Sorry, this is a very big age"
break
else:
print "Enter the second age:"
num2 = int(sys.stdin.readline())
if num1 > 100:
print "Sorry, this is a very big age"
break
else:
print "Enter the third age:"
num3 = int(sys.stdin.readline())
if num1 > 100:
print "Sorry, this is a very big age"
break
else:
print "Enter the fourth age:"
num4 = int(sys.stdin.readline())
if num1 > 100:
print "Sorry, this is a very big age"
break
else:
num1 = num1 + yearstoadd
num2 = num2 + yearstoadd
num3 = num3 + yearstoadd
num4 = num4 + yearstoadd
print "The new ages are %s, %s, %s and %s"% (num1, num2, num3, num4)
time.sleep(10)
When I run this code, this error appears:
C:\Documents and Settings\Administrator\Desktop>agefinder.py
File "C:\Documents and Settings\Administrator\Desktop\agefinder.py", line 17
else:
^
SyntaxError: invalid syntax