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=='Re':
area=rectangle()
elif s=='t' or s=='T':
area=triangle()
elif s=='q' or s=='Q':
flag=False
print ['the area is ', circle(),rectangle(),triangle()]
###程序运行截图
我也是醉了,粗心惹得祸,area=circle( )=rectagnle( )=triangle( )