个人简介

Echo Blog


江湖无名 安心练剑
  • Python-07-Function 函数的定义和使用
    定义函数 说明 关键字 def 引入一个函数 定义。 它必须后跟函数名称和带括号的形式参数列表。 构成函数体的语句从下一行开始,并且必须缩进。 函数体的第一个语句可以(可选的)是字符串文字;这个字符串文字是函数的文档字符串或 docstring 。(有关文档字符串的更多信息,请参阅 文档字符串 部分)有些工具使用文档字符串自动生成在线或印刷文档,或者让用户以交互式的形式浏览代码;在...
    2018-02-14 07:09:30 | Lang
  • Python-06-流程控制
    if if.py ''' func: if 测试 author: binbin.hou ''' x = int(input("Enter an int: ")) if x <= 18: print("Young") elif x < 50: print("Adult") elif x < 100: print("Old") else: print("Am...
    2018-02-14 07:09:30 | Lang
  • Python-05-基本数据类型
    数字 基本运算 表达式的语法很直接:运算符 +、-、*、/ 的用法和其他大部分语言一样(比如 Pascal 或者 C 语言);括号 (()) 用来分组。 >>> 1+2 3 >>> 1-2 -1 >>> 3*2 6 >>> 3/2 1.5 >>> 1*(2+3) 5 除法运算 除法运算 (/...
    2018-02-14 07:09:30 | Lang
  • Python-04-文件编码
    解释器的运行环境 源文件的字符编码 默认情况下,Python 源码文件以 UTF-8 编码方式处理。 在这种编码方式中,世界上大多数语言的字符都可以同时用于字符串字面值、变量或函数名称以及注释中——尽管标准库中只用常规的 ASCII 字符作为变量或函数名,而且任何可移植的代码都应该遵守此约定。 要正确显示这些字符,你的编辑器必须能识别 UTF-8 编码,而且必须使用能支持打开的文件中...
    2018-02-14 07:09:30 | Lang
  • Python-03 基础语法
    Python Python is powerful… and fast; plays well with others; runs everywhere; is friendly & easy to learn; is Open. python zh_CN Hello World Install cmd C:\Users\...
    2018-02-14 07:09:30 | Lang
  • Python-02-Python Windows 环境 windows install python 3.x
    Windows 环境 下载 Windows Python 下载 安装 此处我选择的 python 3.X 下载之后,直接双击安装即可。 记得选择 【Add To Path】,就省得手动配置 python 路径了。 测试 打开命令行,输入 python 信息如下: >python Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019...
    2018-02-14 07:09:30 | Lang
  • Python-02-Python Mac 环境
    Mac V 2.X 在 mac 中,默认的 python 版本为: Python 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin Type "help", "copyright", "credits" or "licen...
    2018-02-14 07:09:30 | Lang
  • Python-02-Python Windows 环境 linux 如何安装 python 3.x?
    版本验证 python --version 如下: $ python --version Command 'python' not found, did you mean: command 'python3' from deb python3 command 'python' from deb python-is-python3 安装 通过命令: sudo apt-g...
    2018-02-14 07:09:30 | Lang