标签:pytho 数据 utf-8 出错 usr 断言 int python pre
#!/usr/bin/env python # _*_ coding:utf-8 _*_ # Author:CarsonLi ‘‘‘ 断言一般用于后面有非常重要的操作,需要使用前面的数据,而且不容许出错 这里就用的到断言,也可以用 ‘‘‘ name="Bert" assert type(name) is str print("断言name是str类型") assert type(name) is not int print("断言不是int 类型")
标签:pytho 数据 utf-8 出错 usr 断言 int python pre
原文地址:https://www.cnblogs.com/bert227/p/9787016.html