def circle():
r=input('please enter the radius of the circle:')
area=3.14*r**2
return area
def rectangle():
l=input('please enter the length of the rectangle:')
w=input('please enter the wide of the rectangle:')
area=l*w
return area
def triangle():
l=input('please enter the length of triangle\'s bottm:')
h=input('please enter the height of the triangle:')
area=0.5*h*l
return area
flag=True
while flag:
print ('\n please to select C ,R,T, Q:')
Print ('c: circle')
print ('R: rectangle')
print ('T: triangle')
print ('Q: quit')
s=raw_input('Please enter the C,T,R,Q)
if s=='C' or s=='c':
area=circle()
elif s=='R' or s=='r':
area==rectangle()
elif s=='T' or s=='t':
area==triangle()
elif s=='Q' or s=='t':
flag=False
print ['the area is ', circle()]
第六行的冒号不是英文冒号
多谢,多谢,已经解决~~~出现Non-AScii character时就应该考虑到冒号是中文的,不过还是要多谢您的指教!