fork download
  1. import re
  2. l=[["NBC","45","42"],["IBM","24","67"],["JIW","25"]]
  3. #print l[0],l[1],l[2]
  4.  
  5.  
  6.  
  7. n=0
  8. for n in range(3):
  9. if re.match(l[n][0],"NBC").group():
  10. print"1he"
  11. #break or continue
  12. elif re.match(l[n][0],"IBM").group():
  13. print"2he"
  14. #break
  15. elif re.match(l[n][0],"JIW").group():
  16. print"3he"
  17. #break
  18. else:print"no"
Runtime error #stdin #stdout #stderr 0.01s 23304KB
stdin
Standard input is empty
stdout
1he
stderr
Traceback (most recent call last):
  File "prog.py", line 9, in <module>
AttributeError: 'NoneType' object has no attribute 'group'