![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python编程
会飞的鱼fly
这个作者很懒,什么都没留下…
展开
-
1.python输入
Python3 input() 函数:Python3.x 中 input() 函数接受一个标准输入数据,返回为 string 类型。注:在 Python3.x 中 raw_input() 和 input() 进行了整合,去除了 raw_input( ),仅保留了input( )函数,其接收任意任性输入,将所有输入默认为字符串处理,并返回字符串类型。链接: link.sys.stdin....原创 2019-08-08 12:59:41 · 1640 阅读 · 0 评论 -
python 列表切片
# -*- coding: UTF-8 -*-s = 'abcdefg'# 返回从起始位置到索引位置 2 处的字符串切片print(s[:3]) # 输出 'abc'# 返回从第三个索引位置到结尾的字符串切片print(s[3:]) # 输出 'defg'# 字符串逆序输出print(s[::-1]) # 输出 'gfedcba'# 输出从开始位置间隔一个字符组成的字符串...原创 2019-08-17 16:46:03 · 66 阅读 · 0 评论