Python简介:
1. 由 Guido van Rossum在1989年编写的一个编程语言。优雅, 明确, 简单。
2. 适合开发网络应用, 小工具
3. 解释型语言, 没有编译和链接, 可以节省程序开发过程中的大量时间
4. 缺点: 速度慢, 不能加密。
Python 格式
缩进区分
单行注释: #
编码: #-*- coding: utf-8 -*-
Python输入/输出
print("hello, world"), print('hello, world')
print('this', 'is', 'a', 'new', 'world')
print(‘%s', %num)
input([prompt])
Notes:
1. Python 区分大小写。
2. Python3.3以后, input()和raw_input()合并, If the prompt argument is present, it is written to standard output without a trailing newline. The function then reads a line frominput, converts it to a string
3. 参数格式化输出
- #%x --- hex 十六进制
- #%d --- dec 十进制
- #%o --- oct 八进制
- #%s --- 字符串
- #%f --- float 浮点数