首页 新闻 会员 周边

求老师回复,照抄的程序,到line 6就报错

0
悬赏园豆:5 [已解决问题] 解决于 2017-06-22 16:57

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()]

hh_ray的主页 hh_ray | 初学一级 | 园豆:200
提问于:2017-06-22 15:57
< >
分享
最佳答案
1

第六行的冒号不是英文冒号

收获园豆:5
懒惰的咕噜 | 菜鸟二级 |园豆:214 | 2017-06-22 16:44

多谢,多谢,已经解决~~~出现Non-AScii character时就应该考虑到冒号是中文的,不过还是要多谢您的指教!

hh_ray | 园豆:200 (初学一级) | 2017-06-22 16:55
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册