美文网首页
基础知识点

基础知识点

作者: 天字一等 | 来源:发表于2019-04-25 18:35 被阅读0次

python基础知识点:

class:#创建类  类就是一个模板,模板里可以包含多个函数,函数里实现一些功能   [https://www.cnblogs.com/chengd/articles/7287528.html](https://www.cnblogs.com/chengd/articles/7287528.html)

def:#创建类中函数
pass:pass 不做任何事情,一般用做占位语句。
if __name__ == '__main__':的作用
[https://www.cnblogs.com/kex1n/p/5975575.html](https://www.cnblogs.com/kex1n/p/5975575.html)
5、python range() 函数可创建一个整数列表,一般用在 for 循环中。
函数语法
range(start, stop[, step])
6、Python len() 方法返回对象(字符、列表、元组等)长度或项目个数。
语法
len()方法语法:
len( s )
7、_init_
[https://blog.csdn.net/geerniya/article/details/77487941](https://blog.csdn.net/geerniya/article/details/77487941)

8、try catch
https://www.cnblogs.com/Lival/p/6203111.html
9、return只能在def函数里
10、if not

# if not x 相当于if x is None ,x等于None,  False, 空字符串"", 0, 空列表[], 空字典{}, 空元组()的时候,if not x为if True

相关文章

网友评论

      本文标题:基础知识点

      本文链接:https://www.haomeiwen.com/subject/joftnqtx.html