正向打印的时候

for i in range(2):
print(i) 打印的结果
0
1

反向的时候

for i in range(2,-1,-1):
print(i) 2
1
0
for i in range(3,0,-1):
print(i)

3
2
1
0
-1

 

range的新发现的更多相关文章

  1. SQL Server 合并复制遇到identity range check报错的解决

        最近帮一个客户搭建跨洋的合并复制,由于数据库非常大,跨洋网络条件不稳定,因此只能通过备份初始化,在初始化完成后向海外订阅端插入数据时发现报出如下错误: Msg 548, Level 16, S ...

  2. Java 位运算2-LeetCode 201 Bitwise AND of Numbers Range

    在Java位运算总结-leetcode题目博文中总结了Java提供的按位运算操作符,今天又碰到LeetCode中一道按位操作的题目 Given a range [m, n] where 0 <= ...

  3. [LeetCode] Range Addition 范围相加

    Assume you have an array of length n initialized with all 0's and are given k update operations. Eac ...

  4. [LeetCode] Count of Range Sum 区间和计数

    Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Ra ...

  5. [LeetCode] Range Sum Query 2D - Mutable 二维区域和检索 - 可变

    Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper lef ...

  6. [LeetCode] Range Sum Query - Mutable 区域和检索 - 可变

    Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive ...

  7. [LeetCode] Range Sum Query 2D - Immutable 二维区域和检索 - 不可变

    Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper lef ...

  8. [LeetCode] Range Sum Query - Immutable 区域和检索 - 不可变

    Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive ...

  9. [LeetCode] Bitwise AND of Numbers Range 数字范围位相与

    Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers ...

随机推荐

  1. 源码mysql-5.7.23在cmake时出现的小问题

    我是写的脚本安装mysql,cmake的步骤,另外用了一个小脚本,然后在脚本中用的bash执行的cmake命令,所以导致cmake实在子shell中执行的, 如果你是在命令行上一步一步的执行,报这个错 ...

  2. Java中的CAS实现原理

    一.什么是CAS? 在计算机科学中,比较和交换(Conmpare And Swap)是用于实现多线程同步的原子指令. 它将内存位置的内容与给定值进行比较,只有在相同的情况下,将该内存位置的内容修改为新 ...

  3. [easyUI] autocomplete 简单自动完成以及ajax从服务器端完成

    通过id取input标签对象,调用autocomplete方法 <script> var sources = [ "ActionScript", "Apple ...

  4. vscode ----> 学习笔记

    java开发环境 jdk配置 maven配置 file --> preferences --> settings 在search settings搜索关键词 java.home , mav ...

  5. jvm是如何管理内存的 .ZT

    http://blog.csdn.net/u014421556/article/details/51744044

  6. [atcoder contest 010] F - Tree Game

    [atcoder contest 010] F - Tree Game Time limit : 2sec / Memory limit : 256MB Score : 1600 points Pro ...

  7. ceph问题总结

    之前测试用ceph总是警告 health HEALTH_WARN pool cephfs_metadata2 has many more objects per pg than average (to ...

  8. 如何加快C++代码的编译速度 转 ccache

    http://www.cnblogs.com/baiyanhuang/archive/2010/01/17/1730717.html   C++代码一直以其运行时的高性能高调面对世人, 但是说起编译速 ...

  9. html页面调用js文件里的函数报错-->方法名 is not defined处理方法

    前几天写了一个时间函数setInterval,然后出现了这个错误:Uncaught ReferenceError: dosave is not defined(…) 找了半天都没发现错在哪,最后找到解 ...

  10. Linux过滤错误日志

    grep -E 'at |Exception|exception|Error|error|Caused by' test.log