Python
金沙江浪子
这个作者很懒,什么都没留下…
展开
-
python常用知识点笔记-函数
导入函数: def IsInstence(x):#数据类型检查,如果不是给定类型中的一种则抛出异常。 if not isinstance(x,(int,float)): print("true\n") else: raise TypeError('bad operand type') IsInstence(3) import math def test(): return math.pi,math.e,math....原创 2021-12-13 12:01:55 · 886 阅读 · 0 评论 -
python笔记:冒号和>>>区别
CPython。这个解释器是用 C 语言开发的, 所以叫 CPython。在命令行下运行 python 就是启动 CPython 解释器。 CPython 是使用最广的 Python 解释器 IPython 是基于 CPython 之上的一个交互式解释器 CPython 用>>>作为提示符,而 IPython 用 In [序号]:作为提示符 ...原创 2021-12-09 15:12:22 · 477 阅读 · 0 评论 -
usr/bin/python3
#在Linux无法执行,需要在vi下执行:set ff=unix 保存后再执行 #!/usr/bin/python3 print("Hello, World!")原创 2021-12-07 15:12:48 · 936 阅读 · 0 评论