演示断言 2015/03/01 14540 #演示断言 #!/usr/local/bin/python2.5 def f(x): assert x < 1,'x must >= 1' return x**2 print f(1)