python入门
来源:互联网 发布:大数据价值密度 编辑:程序博客网 时间:2024/06/05 10:32
1、安装
在官网上下载即可:http://www.python.org/
2、hello world
安装之后,按照网上的教程,发现失败了。
>>> print "hello world!" File "<stdin>", line 1 print "hello world!" ^SyntaxError: Missing parentheses in call to 'print'
研究之后,网上的教程多是针对python3.0之前的版本,而python3.0以上的版本需要加括号,也就是说由print语句演变成print()函数。
这也提醒我们python3.0之后的版本语法和之前的有很大的不同,详见:http://blog.csdn.net/mountainest/article/details/77140645。
>>> print("hello world!")hello world!>>> print('hello world!')hello world!
3、帮助命令
help(keywords)或者keywords help
>>> help(print)Help on built-in function print in module builtins:print(...) print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False) Prints the values to a stream, or to sys.stdout by default. Optional keyword arguments: file: a file-like object (stream); defaults to the current sys.stdout. sep: string inserted between values, default a space. end: string appended after the last value, default a newline. flush: whether to forcibly flush the stream.
阅读全文
0 0
- Python入门
- python入门
- Python入门
- Python入门
- Python入门
- Python入门
- python入门
- Python入门
- Python 入门
- Python入门
- python入门
- Python入门
- python入门
- python入门
- Python入门
- python 入门
- python入门
- python入门
- Socket UDP上报读取对象
- CNN_LSTM
- 我的第一篇博客—IT之路.ZCSDN.2017.7.7
- 欢迎使用CSDN-markdown编辑器
- 文件拖拽功能窗口实现
- python入门
- 关于RDB三范式简明易记
- 支付宝支付流程图解
- 使用RNN模拟CNN中每个卷积层的关系
- Log4j(一)----基本介绍篇
- B1048. 数字加密(20)
- Android--Native与html5交互
- 移动零
- java.lang.ClassCastException: android.os.BinderProxy cannot be cast to ………………