码迷,mamicode.com
首页 > 编程语言 > 详细

009 python语法_类 range

时间:2018-10-28 22:59:59      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:python   ali   nts   integer   when   tin   spec   文件   and   

技术分享图片

 

 

‘‘‘
时间:2018/10/28
目录: 
  一: 概述
        1 help查看
        2 文件查看
        3 类型查看
  二: 使用
        1 说明
        2 举例
‘‘‘

 

一: 概述
  1 help查看

# coding:utf-8

help(range)
Help on class range in module builtins:

class range(object)
 |  range(stop) -> range object
 |  range(start, stop[, step]) -> range object

 

  2 文件查看

    range(stop) -> range object
    range(start, stop[, step]) -> range object
    
    Return an object that produces a sequence of integers from start (inclusive)
    to stop (exclusive) by step.  range(i, j) produces i, i+1, i+2, ..., j-1.
    start defaults to 0, and stop is omitted!  range(4) produces 0, 1, 2, 3.
    These are exactly the valid indices for a list of 4 elements.
    When step is given, it specifies the increment (or decrement).

 

  3 类型查看

# coding:utf-8

print(type(range))
<class type>

 

二: 使用
  1 说明
  2 举例

 

009 python语法_类 range

标签:python   ali   nts   integer   when   tin   spec   文件   and   

原文地址:https://www.cnblogs.com/huafan/p/9867695.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!