18 lines
564 B
Markdown
18 lines
564 B
Markdown
|
# Python学习基础笔记
|
||
|
|
||
|
## 一. 基本输入输出
|
||
|
1. print()
|
||
|
|
||
|
用print()在括号中加上字符串,就可以向屏幕上输出指定的文字。比如输出'hello, world',用代码实现如下:
|
||
|
> print('hello, world')
|
||
|
|
||
|
print()函数也可以接受多个字符串,用逗号“,”隔开,就可以连成一串输出:
|
||
|
> print('The quick brown fox', 'jumps over', 'the lazy dog')
|
||
|
|
||
|
The quick brown fox jumps over the lazy dog
|
||
|
|
||
|
print()会依次打印每个字符串,遇到逗号“,”会输出一个空格.
|
||
|
|
||
|
2. input()
|
||
|
|