Python

Python 复读笔记(1)

2016-03-17  本文已影响95人  57fc17b7d598
  1. Python命令行的交互模式


    交互模式

<pre>

10 / 3
3.3333333333333335
10 // 3
3
2 ** 2
4
5 ** 2
25
_
25
_ * 10
250
</pre>

'string'
'string'
"string"
'string'
"""string"""
'string'
'string' == "string" == """string"""
True
'abc'abc'
"abc'abc"
"yes" * 3
'yesyesyes'
"12121212"[0:6:2]
'111'
"12121212"[::2]
'1111'
for s in "abc": print(s);
...
a
b
c
"abc"
... "def"
'abcdef'
</pre>

上一篇 下一篇

猜你喜欢

热点阅读